|
|
|
@ -16,7 +16,7 @@ import aiohttp
|
|
|
|
|
|
|
|
|
|
from settings import *
|
|
|
|
|
|
|
|
|
|
IGNORE_NICKS = ["monerobux", "denise"]
|
|
|
|
|
IGNORE_NICKS = ["monerobux", "denise", "quotez"]
|
|
|
|
|
TASK_QUEUE = asyncio.Queue()
|
|
|
|
|
TASK_AUTHORS = {}
|
|
|
|
|
FONT = ImageFont.truetype('font-bold.ttf', 22)
|
|
|
|
@ -185,11 +185,15 @@ async def handle_msg(nick, msg, target, now: float):
|
|
|
|
|
|
|
|
|
|
if "re @" in msg:
|
|
|
|
|
return
|
|
|
|
|
if "!dall" not in msg:
|
|
|
|
|
if "!dall " not in msg:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
msg = msg[msg.find("!dall"):]
|
|
|
|
|
msg = msg[5:].strip()
|
|
|
|
|
if not SCANLINE:
|
|
|
|
|
if not msg.strip().startswith("!dall "):
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
msg = msg[msg.find("!dall "):]
|
|
|
|
|
msg = msg[6:].strip()
|
|
|
|
|
|
|
|
|
|
if len(msg) <= 8:
|
|
|
|
|
return _err(target, f"longer query required.")
|
|
|
|
@ -197,13 +201,13 @@ async def handle_msg(nick, msg, target, now: float):
|
|
|
|
|
TASK_AUTHORS.setdefault(nick, 0)
|
|
|
|
|
if TASK_AUTHORS[nick] >= 4:
|
|
|
|
|
err = f"{nick}: you already queued 4 thingies, patient!!11"
|
|
|
|
|
bot.send("NOTICE", target=target, message=err)
|
|
|
|
|
bot.send("PRIVMSG", target=target, message=err)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
TASK_AUTHORS[nick] += 1
|
|
|
|
|
task = Task(channel=target, author=nick, term=msg, dt=int(now))
|
|
|
|
|
await TASK_QUEUE.put(task)
|
|
|
|
|
bot.send("NOTICE", target=target, message=f"generating...")
|
|
|
|
|
bot.send("PRIVMSG", target=target, message=f"generating...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def main():
|
|
|
|
@ -252,7 +256,9 @@ async def main():
|
|
|
|
|
_lower_author_task_count(task.author)
|
|
|
|
|
|
|
|
|
|
completed_secs = int((datetime.now() - now).total_seconds())
|
|
|
|
|
bot.send("NOTICE", target=task.channel, message=f"{url} \"{task.term_short}\" (total: {completed_secs}s, {task.author}) ")
|
|
|
|
|
bot.send("NOTICE" if NOTICES else "PRIVMSG",
|
|
|
|
|
target=task.channel,
|
|
|
|
|
message=f"{url} \"{task.term_short}\" (total: {completed_secs}s, {task.author}) ")
|
|
|
|
|
await asyncio.sleep(10)
|
|
|
|
|
|
|
|
|
|
loop = asyncio.get_event_loop()
|
|
|
|
|