3
3
from utils .shortcuts import no_ping
4
4
from asyncio import sleep
5
5
from random import choice
6
+ from re import compile
6
7
7
- else_dead_chat_msgs = {
8
+ dead_chat_link_re = compile (r"https://tenor\.com/view/[^ ]*dead[^ ]*chat[^ ]*" )
9
+
10
+
11
+ dead_chat_gifs = [
12
+ "https://tenor.com/view/dead-chat-dead-chat-skeleton-gif-25954239" ,
13
+ "https://tenor.com/view/dead-chat-gif-26094097" ,
14
+ "https://tenor.com/view/dead-group-chat-gif-23637113" ,
15
+ "https://tenor.com/view/minecraft-dead-chat-dead-chat-xd-gif-24629150"
16
+ ]
17
+
18
+ else_dead_chat_msgs = [
8
19
"Эээ это моя работа" ,
9
20
"Ну йомайо теперь снова ждать" ,
10
21
"Та блин я так долго сидел ждал" ,
11
22
"э" ,
12
23
"та ну что ж такое" ,
13
24
"хватит за меня отправлять" ,
14
25
"ну когда уже я смогу отправить"
15
- }
26
+ ]
16
27
17
28
class DeadChat (commands .Cog ):
18
29
def __init__ (self , bot ):
@@ -28,10 +39,10 @@ async def dead_chat(self, msg):
28
39
if current_time .hour >= 0 and current_time .hour < 5 :
29
40
return
30
41
new_message_id = msg .id
31
- if "https://tenor.com/view/ultra-dead-chat-dead-chat-gif-27600164" in msg .content .lower ():
32
- await msg .reply (choice (list ( else_dead_chat_msgs ) ), allowed_mentions = no_ping )
42
+ if dead_chat_link_re . search ( msg .content .lower () ):
43
+ await msg .reply (choice (else_dead_chat_msgs ), allowed_mentions = no_ping )
33
44
34
45
await sleep (4 * 60 * 60 )
35
46
latest_messages = [msg async for msg in msg .channel .history (limit = 1 )]
36
47
if latest_messages [0 ].id == new_message_id :
37
- await msg .channel .send ("https://tenor.com/view/ultra-dead-chat-dead-chat-gif-27600164" )
48
+ await msg .channel .send (choice ( dead_chat_gifs ) )
0 commit comments