Fix for IRC bridge bots

This commit is contained in:
dsc 2022-07-20 05:46:02 +02:00
parent 44015f2475
commit 0ea32e8c21

View file

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