From 37914e1f1c6986b78b2ba75a576b19f75f440016 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 19 Jun 2019 09:11:56 -0400 Subject: [PATCH] start of reddit testing --- sopel_modules/SpiceBot/Reddit.py | 14 ++++++++++ sopel_modules/SpiceBot/__init__.py | 1 + .../SpiceBot_Core_Commands/Reddit.py | 27 +++++++++++++++++++ .../SpiceBot_Core_Commands/__init__.py | 1 + 4 files changed, 43 insertions(+) create mode 100644 sopel_modules/SpiceBot/Reddit.py create mode 100644 sopel_modules/SpiceBot_Core_Commands/Reddit.py diff --git a/sopel_modules/SpiceBot/Reddit.py b/sopel_modules/SpiceBot/Reddit.py new file mode 100644 index 0000000..1cf973d --- /dev/null +++ b/sopel_modules/SpiceBot/Reddit.py @@ -0,0 +1,14 @@ +# coding=utf8 +from __future__ import unicode_literals, absolute_import, division, print_function +""" +This is the SpiceBot Reddit system. +""" + + +class BotReddit(): + """This Logs all channels known to the server""" + def __init__(self): + self.dict = {} + + +reddit = BotReddit() diff --git a/sopel_modules/SpiceBot/__init__.py b/sopel_modules/SpiceBot/__init__.py index 90787d3..fac2d5c 100644 --- a/sopel_modules/SpiceBot/__init__.py +++ b/sopel_modules/SpiceBot/__init__.py @@ -25,6 +25,7 @@ from .AI import * from .Google import * from .Gif import * from .Sherlock import * +from .Reddit import * from .configure import * diff --git a/sopel_modules/SpiceBot_Core_Commands/Reddit.py b/sopel_modules/SpiceBot_Core_Commands/Reddit.py new file mode 100644 index 0000000..b442915 --- /dev/null +++ b/sopel_modules/SpiceBot_Core_Commands/Reddit.py @@ -0,0 +1,27 @@ +# coding=utf-8 + +from __future__ import unicode_literals, absolute_import, division, print_function + +import sopel.module + +# import sopel_modules.SpiceBot as SpiceBot + + +@sopel.module.rule(r"""(?:)u/ + ( + (?:\\/ | [^/])+ + ) + """) +def bot_command_reddit_user(bot, trigger): + bot.osd(str(trigger)) + bot.osd(str(trigger.args)) + + +@sopel.module.rule(r"""(?:)r/ + ( + (?:\\/ | [^/])+ + ) + """) +def bot_command_reddit_subreddit(bot, trigger): + bot.osd(str(trigger)) + bot.osd(str(trigger.args)) diff --git a/sopel_modules/SpiceBot_Core_Commands/__init__.py b/sopel_modules/SpiceBot_Core_Commands/__init__.py index cf853c4..6ec62d5 100644 --- a/sopel_modules/SpiceBot_Core_Commands/__init__.py +++ b/sopel_modules/SpiceBot_Core_Commands/__init__.py @@ -20,6 +20,7 @@ from .Search import * from .AI import * from .Gif import * from .Sherlock import * +from .Reddit import * __author__ = 'Sam Zick' __email__ = 'sam@deathbybandaid.net'