From fcbaef50ef06f6071b74eb5a08cde6b88c089b7c Mon Sep 17 00:00:00 2001 From: jsl12 <32917998+jsl12@users.noreply.github.com> Date: Wed, 2 Feb 2022 13:28:42 -0600 Subject: [PATCH] added some jokes --- src/kwaylon/jokes/jokes.py | 31 +++++++++++++++++++++++++++++++ src/main.py | 10 +++++----- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/kwaylon/jokes/jokes.py b/src/kwaylon/jokes/jokes.py index 51ff754..cc855b1 100644 --- a/src/kwaylon/jokes/jokes.py +++ b/src/kwaylon/jokes/jokes.py @@ -1,5 +1,6 @@ import logging import re +from random import choice from nextcord import Client, Message from nextcord import utils @@ -126,3 +127,33 @@ class ChiliJoke(base.GifJoke): @property def regex(self) -> re.Pattern: return re.compile('chil(i|ly)', re.IGNORECASE) + + +class Jaccuse(base.Joke): + urls = [ + 'https://tenor.com/view/jaccuse-the-good-fight-i-accuse-im-accusing-you-paramount-plus-gif-21890096', + 'https://tenor.com/view/glee-jaccuse-i-accuse-blame-shouting-gif-17122248', + 'https://tenor.com/view/jaccuse-gif-5729034', + 'https://tenor.com/view/jaccuse-frankie-lily-tomlin-grace-and-frankie-accuse-gif-17551378', + 'https://tenor.com/view/michael-gove-gove-jaccuse-accuse-conservatives-gif-17652472' + ] + + @property + def regex(self) -> re.Pattern: + return re.compile('j\'?accuse', re.IGNORECASE) + + async def respond(self, message: Message, client: Client, match: re.Match): + if message.reference is not None: + initial = await message.channel.fetch_message(message.reference.message_id) + await initial.reply(choice(self.urls)) + else: + await message.reply(choice(self.urls)) + + +class GoodBot(base.Joke): + @property + def regex(self) -> re.Pattern: + return re.compile('(\w+) bot', re.IGNORECASE) + + async def respond(self, message: Message, client: Client, match: re.Match): + await message.add_reaction(utils.get(client.emojis, name='kaylon')) diff --git a/src/main.py b/src/main.py index 5262538..b876fe3 100644 --- a/src/main.py +++ b/src/main.py @@ -17,11 +17,11 @@ if __name__ == '__main__': @client.event async def on_ready(): await client.handle_ready() - await client.data.scan_messages( - client=client, - # limit=50, - days=2, - ) + # await client.data.scan_messages( + # client=client, + # limit=50, + # # days=7, + # ) # chan = await client.fetch_channel(690588413543579649) # msg = await chan.fetch_message(936684979654623293) # logging.info(f'Msg: {msg.clean_content}')