mirror of
https://git.wownero.com/dsc/craiyon-irc.git
synced 2024-08-15 01:03:24 +00:00
Fix for IRC bridge bots
This commit is contained in:
parent
44015f2475
commit
0ea32e8c21
1 changed files with 4 additions and 1 deletions
5
main.py
5
main.py
|
@ -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…
Reference in a new issue