Simplify rework

This commit is contained in:
Firepup Sixfifty 2023-11-20 20:18:30 -06:00
parent 058a97eaf7
commit 478bcb9d04
Signed by: Firepup650
GPG key ID: 7C92E2ABBBFAB9BA

View file

@ -136,13 +136,11 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str]
if chan in bot.channels and bot.channels[chan] >= bot.interval: if chan in bot.channels and bot.channels[chan] >= bot.interval:
r.seed() r.seed()
bot.channels[chan] = 0 bot.channels[chan] = 0
mm = open("mastermessages.txt", "r") with open("mastermessages.txt", "r") as mm:
q = mm.readlines() sel = conf.decode_escapes(
sel = conf.decode_escapes( str(r.sample(mm.readlines(), 1)).strip("[]'").replace("\\n", "").strip('"')
str(r.sample(q, 1)).strip("[]'").replace("\\n", "").strip('"') )
) bot.msg(f"[QUOTE] {sel}", chan)
bot.msg(f"[QUOTE] {sel}", chan)
mm.close()
return None, None return None, None