From 9dd2503900c88f74791aedf7ebba8a2fa4f27dc7 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 19 Jun 2019 10:59:41 -0400 Subject: [PATCH] test --- sopel_modules/SpiceBot/Reddit.py | 5 ++--- sopel_modules/SpiceBot_Core_Commands/Reddit.py | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/sopel_modules/SpiceBot/Reddit.py b/sopel_modules/SpiceBot/Reddit.py index 55f0cd2..522303f 100644 --- a/sopel_modules/SpiceBot/Reddit.py +++ b/sopel_modules/SpiceBot/Reddit.py @@ -28,7 +28,7 @@ class BotReddit(): """This Logs all channels known to the server""" def __init__(self): self.setup_reddit() - self.dict = {} + self.cache = {} self.header = {'User-Agent': str(UserAgent().chrome)} self.client_id = botconfig.SpiceBot_Reddit.client_id self.client_secret = botconfig.SpiceBot_Reddit.client_secret @@ -174,6 +174,7 @@ class BotReddit(): try: subtype = self.praw.subreddit(sub).subreddit_type + returndict["subtype"] = subtype except Exception as e: returndict["exists"] = False if str(e) == "received 403 HTTP response": @@ -185,8 +186,6 @@ class BotReddit(): else: returndict["error"] = str(sub + " appears to not have a type") return returndict - return subtype - return returndict def reddit_user_exists(self, user): diff --git a/sopel_modules/SpiceBot_Core_Commands/Reddit.py b/sopel_modules/SpiceBot_Core_Commands/Reddit.py index f9cc588..f6d54cd 100644 --- a/sopel_modules/SpiceBot_Core_Commands/Reddit.py +++ b/sopel_modules/SpiceBot_Core_Commands/Reddit.py @@ -12,16 +12,11 @@ import sopel_modules.SpiceBot as SpiceBot (?:\\/ | [^/])+ ) """) -def bot_command_reddit_user(bot, trigger): - message = SpiceBot.reddit.prerun(trigger) - bot.osd(str(message)) - - @sopel.module.rule(r"""(?:)r/ ( (?:\\/ | [^/])+ ) """) -def bot_command_reddit_subreddit(bot, trigger): +def bot_command_reddit_user(bot, trigger): message = SpiceBot.reddit.prerun(trigger) bot.osd(str(message))