Fix for IRC bridge bots

master
dsc 2 years ago
parent 44015f2475
commit 0ea32e8c21

@ -1,3 +1,4 @@
import re
import time
import os
import random
@ -155,6 +156,8 @@ async def message_received(nick, target, message, **kwargs):
return
msg = message
msg = msg.replace("!dall", " !dall")
msg = re.sub(r'!\W+', ' ', msg)
now = datetime.now()
now = time.mktime(now.timetuple())
await handle_msg(nick, msg, target, now)
@ -170,7 +173,7 @@ async def handle_msg(nick, msg, target, now: float):
return
spl = msg.split(' ')
if "!dall" not in spl[:2]:
if "!dall" not in spl[:3]: # stupid fix for IRC bridge bots
return
msg = msg[msg.find("!dall"):]

Loading…
Cancel
Save