Fix for IRC bridge bots

This commit is contained in:
dsc 2022-07-20 05:46:02 +02:00
parent 44015f2475
commit 0ea32e8c21
1 changed files with 4 additions and 1 deletions

View File

@ -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"):]