Skip to content

Commit d6d65a4

Browse files
authored
Merge pull request CloudBotIRC#148 from linuxdaemon/gonzobot+load-fixes
Fix various errors/warnings during plugin load
2 parents d67119c + 7cdd414 commit d6d65a4

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

plugins/bible.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from cloudbot import hook
44

5-
@hook.command("bible", "passage", singlethreaded=True)
5+
@hook.command("bible", "passage", singlethread=True)
66
def bible(text):
77
"""Prints the specified passage from the Bible"""
88
passage = text.strip()

plugins/imgur.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ def get_items(text):
4949
def load_api(bot):
5050
global imgur_api
5151

52-
client_id = bot.config.get("api_keys", {}).get("imgur_client_id")
53-
client_secret = bot.config.get("api_keys", {}).get("imgur_client_secret")
52+
api_keys = bot.config.get("api_keys", {})
53+
client_id = api_keys.get("imgur_client_id")
54+
client_secret = api_keys.get("imgur_client_secret")
5455

55-
if None in (client_id, client_secret):
56+
if not (client_id and client_secret):
57+
# Either the client id or secret aren't specified
5658
imgur_api = None
5759
return
5860
else:

plugins/quran.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def smart_truncate(content, length=425, suffix='...\n'):
2020
return content[:length].rsplit(' ', 1)[0]+ suffix + content[:length].rsplit(' ', 1)[1] + smart_truncate(content[length:])
2121

2222

23-
@hook.command("quran", "verse", singlethreaded=True)
23+
@hook.command("quran", "verse", singlethread=True)
2424
def quran(text, message):
2525
"""Prints the specified Qur'anic verse(s) and its/their translation(s)"""
2626
api_url = "http://quranapi.azurewebsites.net/api/verse/"

0 commit comments

Comments
 (0)