Skip to content

Commit 1bdb972

Browse files
committed
minor changes
1 parent 1384bce commit 1bdb972

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

cloudbot/bot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(self, loop=asyncio.get_event_loop()):
5353
self.loop = loop
5454
self.start_time = time.time()
5555
self.running = True
56-
# future which will be called when the bot stops
56+
# future which will be called when the bot stopsIf you
5757
self.stopped_future = asyncio.Future(loop=self.loop)
5858

5959
# stores each bot server connection
@@ -90,8 +90,10 @@ def __init__(self, loop=asyncio.get_event_loop()):
9090
self.db_session = scoped_session(self.db_factory)
9191
self.db_metadata = MetaData()
9292

93-
# set botvars.metadata so plugins can access when loading
93+
# set botvars so plugins can access when loading
9494
botvars.metadata = self.db_metadata
95+
botvars.user_agent = self.user_agent
96+
9597
logger.debug("Database system initialised.")
9698

9799
# Bot initialisation complete

cloudbot/util/botvars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
botvars - contains variables set by cloudbot to be easily access
33
"""
44

5-
# MetaData object to be assigned in the CloudBot object initialization
65
# this is assigned in the CloudBot so that its recreated when the bot restarts
76
metadata = None
7+
user_agent = None

plugins/wyr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ def wyr(bot):
1212
r = requests.get(url=API_URL, headers=headers)
1313
data = r.json()
1414

15-
# decrapify text
15+
# clean up text
1616
title = data['title'].strip().capitalize().rstrip('.?,')
1717
choice1 = data['choicea'].strip().lower().rstrip('.?,!').lstrip('.')
1818
choice2 = data['choiceb'].strip().lower().rstrip('.?,!').lstrip('.')
1919
link = data['link']
2020

21-
# get all the words in the answers
21+
# get a list all the words in the answers
2222
text = choice1.split() + choice2.split()
2323
text = [word for word in text if word != "a"]
2424

0 commit comments

Comments
 (0)