Пример #1
0
class Aww:
    url = "https://www.reddit.com/r/aww.json"
    reddit_client = None

    def get_channel_id(self):
        return "all"

    def invoke(self, command, user):
        if not self.reddit_client:
            self.reddit_client = RedditApiClient(self.url)

        attachments = self.reddit_client.fetch()
        return None,attachments

    def get_command(self):
        return "aww"
Пример #2
0
class TeslaMe:
    url = "https://www.reddit.com/r/TeslaPorn.json"
    reddit_client = None

    def get_channel_id(self):
        return "all"

    def invoke(self, command, user):
        if self.reddit_client is None:
            self.reddit_client = RedditApiClient(self.url)

        attachments = self.reddit_client.fetch()
        return None, attachments

    def get_command(self):
        return "teslame"
Пример #3
0
class DogMe():
    url = "https://www.reddit.com/r/puppies.json"
    reddit_client = None

    def get_channel_id(self):
        return "all"

    def configure_api_client(self):
        if self.reddit_client is None:
            self.reddit_client = RedditApiClient(self.url)

    def fetch_data(self):
        return self.reddit_client.fetch()

    def invoke(self, command, user):
        self.configure_api_client()
        attachments = self.fetch_data()
        return None, attachments

    def get_command(self):
        return "dogme"
Пример #4
0
    def invoke(self, command, user):
        if not self.reddit_client:
            self.reddit_client = RedditApiClient(self.url)

        attachments = self.reddit_client.fetch()
        return None,attachments
Пример #5
0
 def configure_api_client(self):
     if self.reddit_client is None:
         self.reddit_client = RedditApiClient(self.url)