@@ -29,7 +29,7 @@ def main():
2929 logger .info ("Starting CloudBot." )
3030
3131 # create the bot
32- bot = CloudBot ()
32+ _bot = CloudBot ()
3333
3434 # whether we are killed while restarting
3535 stopped_while_restarting = False
@@ -40,11 +40,11 @@ def main():
4040 # define closure for signal handling
4141 def exit_gracefully (signum , frame ):
4242 nonlocal stopped_while_restarting
43- if not bot :
43+ if not _bot :
4444 # we are currently in the process of restarting
4545 stopped_while_restarting = True
4646 else :
47- bot .loop .call_soon_threadsafe (lambda : asyncio .async (bot .stop ("Killed" ), loop = bot .loop ))
47+ _bot .loop .call_soon_threadsafe (lambda : asyncio .async (_bot .stop ("Killed" ), loop = _bot .loop ))
4848
4949 # restore the original handler so if they do it again it triggers
5050 signal .signal (signal .SIGINT , original_sigint )
@@ -54,12 +54,12 @@ def exit_gracefully(signum, frame):
5454 # start the bot master
5555
5656 # CloudBot.run() will return True if it should restart, False otherwise
57- restart = bot .run ()
57+ restart = _bot .run ()
5858
5959 # the bot has stopped, do we want to restart?
6060 if restart :
6161 # remove reference to cloudbot, so exit_gracefully won't try to stop it
62- bot = None
62+ _bot = None
6363 # sleep one second for timeouts
6464 time .sleep (1 )
6565 if stopped_while_restarting :
0 commit comments