mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-12 14:39:54 -05:00
test
This commit is contained in:
parent
63a02dfcc6
commit
9dd2503900
@ -28,7 +28,7 @@ class BotReddit():
|
|||||||
"""This Logs all channels known to the server"""
|
"""This Logs all channels known to the server"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.setup_reddit()
|
self.setup_reddit()
|
||||||
self.dict = {}
|
self.cache = {}
|
||||||
self.header = {'User-Agent': str(UserAgent().chrome)}
|
self.header = {'User-Agent': str(UserAgent().chrome)}
|
||||||
self.client_id = botconfig.SpiceBot_Reddit.client_id
|
self.client_id = botconfig.SpiceBot_Reddit.client_id
|
||||||
self.client_secret = botconfig.SpiceBot_Reddit.client_secret
|
self.client_secret = botconfig.SpiceBot_Reddit.client_secret
|
||||||
@ -174,6 +174,7 @@ class BotReddit():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
subtype = self.praw.subreddit(sub).subreddit_type
|
subtype = self.praw.subreddit(sub).subreddit_type
|
||||||
|
returndict["subtype"] = subtype
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
returndict["exists"] = False
|
returndict["exists"] = False
|
||||||
if str(e) == "received 403 HTTP response":
|
if str(e) == "received 403 HTTP response":
|
||||||
@ -185,8 +186,6 @@ class BotReddit():
|
|||||||
else:
|
else:
|
||||||
returndict["error"] = str(sub + " appears to not have a type")
|
returndict["error"] = str(sub + " appears to not have a type")
|
||||||
return returndict
|
return returndict
|
||||||
return subtype
|
|
||||||
|
|
||||||
return returndict
|
return returndict
|
||||||
|
|
||||||
def reddit_user_exists(self, user):
|
def reddit_user_exists(self, user):
|
||||||
|
|||||||
@ -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/
|
@sopel.module.rule(r"""(?:)r/
|
||||||
(
|
(
|
||||||
(?:\\/ | [^/])+
|
(?:\\/ | [^/])+
|
||||||
)
|
)
|
||||||
""")
|
""")
|
||||||
def bot_command_reddit_subreddit(bot, trigger):
|
def bot_command_reddit_user(bot, trigger):
|
||||||
message = SpiceBot.reddit.prerun(trigger)
|
message = SpiceBot.reddit.prerun(trigger)
|
||||||
bot.osd(str(message))
|
bot.osd(str(message))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user