33from utils .shortcuts import no_ping
44from asyncio import sleep
55from random import choice
6+ from re import compile
67
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 = [
819 "Эээ это моя работа" ,
920 "Ну йомайо теперь снова ждать" ,
1021 "Та блин я так долго сидел ждал" ,
1122 "э" ,
1223 "та ну что ж такое" ,
1324 "хватит за меня отправлять" ,
1425 "ну когда уже я смогу отправить"
15- }
26+ ]
1627
1728class DeadChat (commands .Cog ):
1829 def __init__ (self , bot ):
@@ -28,10 +39,10 @@ async def dead_chat(self, msg):
2839 if current_time .hour >= 0 and current_time .hour < 5 :
2940 return
3041 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 )
3344
3445 await sleep (4 * 60 * 60 )
3546 latest_messages = [msg async for msg in msg .channel .history (limit = 1 )]
3647 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