Formatting
This commit is contained in:
parent
958928f4c9
commit
a5e62baae9
3 changed files with 8 additions and 3 deletions
5
bot.py
5
bot.py
|
@ -194,7 +194,10 @@ class bot(bare.bot):
|
||||||
elif code == 475:
|
elif code == 475:
|
||||||
self.log(f"Joining {chan} failed (+k without/with bad key)")
|
self.log(f"Joining {chan} failed (+k without/with bad key)")
|
||||||
if origin != "null":
|
if origin != "null":
|
||||||
self.msg(f"{chan} is +k, and either you didn't give me a key, or you gave me the wrong one.", origin)
|
self.msg(
|
||||||
|
f"{chan} is +k, and either you didn't give me a key, or you gave me the wrong one.",
|
||||||
|
origin,
|
||||||
|
)
|
||||||
break
|
break
|
||||||
elif code == 480:
|
elif code == 480:
|
||||||
self.log(f"Joining {chan} failed (+S)", "WARN")
|
self.log(f"Joining {chan} failed (+S)", "WARN")
|
||||||
|
|
|
@ -189,7 +189,7 @@ def sudo(bot: bare.bot, chan: str, name: str, message: str) -> None:
|
||||||
elif "bot" in name.lower():
|
elif "bot" in name.lower():
|
||||||
bot.log("lol, no.")
|
bot.log("lol, no.")
|
||||||
else:
|
else:
|
||||||
bot.msg('sudo: a password is required', chan)
|
bot.msg("sudo: a password is required", chan)
|
||||||
|
|
||||||
|
|
||||||
def nowplaying(bot: bare.bot, chan: str, name: str, message: str) -> None:
|
def nowplaying(bot: bare.bot, chan: str, name: str, message: str) -> None:
|
||||||
|
|
|
@ -148,12 +148,14 @@ def radio(instance: bare.bot) -> NoReturn:
|
||||||
instance.log("Thread while loop broken", "FATAL")
|
instance.log("Thread while loop broken", "FATAL")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
|
||||||
def ping(instance: bare.bot) -> NoReturn:
|
def ping(instance: bare.bot) -> NoReturn:
|
||||||
while 1:
|
while 1:
|
||||||
instance.sendraw("PING :keepalive")
|
instance.sendraw("PING :keepalive")
|
||||||
sleep(30)
|
sleep(30)
|
||||||
|
|
||||||
|
|
||||||
data: dict[str, dict[str, Any]] = {
|
data: dict[str, dict[str, Any]] = {
|
||||||
"radio": {"noWrap": True, "func": radio, "passInstance": True},
|
"radio": {"noWrap": True, "func": radio, "passInstance": True},
|
||||||
"pingMon": {"noWrap": True, "func": ping, "passInstance": True}
|
"pingMon": {"noWrap": True, "func": ping, "passInstance": True},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue