commit 8d8e9e04306d5a6a4e47b8b489f1e4b88046c494
parent 94e3e84d1ae82b2ac421647177a38bb0d5b9448f
Author: Jake Bauer <jbauer@paritybit.ca>
Date: Sat, 16 Oct 2021 04:16:06 -0400
Improve comments in run.py
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/run.py b/run.py
@@ -21,16 +21,18 @@ def main():
try:
incoming = bot.listen()
- # Properly respond to DMs
+ # Respond to pings
if "PING " in incoming:
print("Responding to PING.")
message = "PONG :" + bot.nick + "\n"
bot.send_message(message)
continue
+ # Properly respond to DMs
if bot.get_channel(incoming) == bot.nick:
incoming = incoming.replace(bot.nick, bot.get_user(incoming))
+ # Supported commands
if ":+quit" in incoming:
quit = bot.quit(incoming)
if quit:
@@ -62,6 +64,7 @@ def main():
elif ":+chgpass" in incoming:
bot.command_chgpass(incoming)
except Exception as e:
+ # Don't die when something goes wrong
bot.handle_exception(incoming, e)
continue