Skip to content

Commit 2cdfa06

Browse files
committed
Rename bot to _bot in launcher
1 parent 4fdc3ef commit 2cdfa06

2 files changed

Lines changed: 5 additions & 23 deletions

File tree

cloudbot/__main__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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:

plugins/soundcloud.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -186,24 +186,6 @@ def soundcloud_user(text):
186186
except APIError as ae:
187187
return ae
188188

189-
@hook.command("scgroup")
190-
def soundcloud_group(text):
191-
"""<query> -- Searches for groups on SoundCloud."""
192-
if not api_key:
193-
return "This command requires a SoundCloud API key."
194-
try:
195-
group = get_with_search('groups', text)
196-
except APIError as ae:
197-
return ae
198-
199-
if not group:
200-
return "No results found."
201-
202-
try:
203-
return format_group(group)
204-
except APIError as ae:
205-
return ae
206-
207189

208190
@hook.regex(SC_RE)
209191
def soundcloud_url(match):

0 commit comments

Comments
 (0)