diff --git a/src/kwaylon/jokes/base.py b/src/kwaylon/jokes/base.py index 2e5ce76..17a6b55 100644 --- a/src/kwaylon/jokes/base.py +++ b/src/kwaylon/jokes/base.py @@ -1,6 +1,6 @@ import re -import nextcord as discord +from nextcord import Message, Client class Joke: @@ -8,15 +8,15 @@ class Joke: def regex(self) -> re.Pattern: raise NotImplementedError - def scan(self, message: discord.Message) -> re.Match: + def scan(self, message: Message) -> re.Match: return self.regex.search(message.content) - async def respond(self, message: discord.Message, client: discord.Client, match: re.Match): + async def respond(self, message: Message, client: Client, match: re.Match): raise NotImplementedError class GifJoke(Joke): url: str - async def respond(self, message: discord.Message, client: discord.Client, match: re.Match): + async def respond(self, message: Message, client: Client, match: re.Match): await message.reply(self.url) diff --git a/src/kwaylon/jokes/jokes.py b/src/kwaylon/jokes/jokes.py index 354e6d5..51ff754 100644 --- a/src/kwaylon/jokes/jokes.py +++ b/src/kwaylon/jokes/jokes.py @@ -68,6 +68,15 @@ class BlackJoke(base.Joke): await msg.add_reaction(utils.get(client.emojis, name='kaylon')) +class BottomJoke(base.Joke): + @property + def regex(self) -> re.Pattern: + return re.compile('(?:\A|[^\w])bottom', re.IGNORECASE) + + async def respond(self, message: Message, client: Client, match: re.Match): + await message.add_reaction(utils.get(client.emojis, name='kaylon')) + + class AssJoke(base.Joke): @property def regex(self) -> re.Pattern: diff --git a/src/main.py b/src/main.py index 7fcf472..5262538 100644 --- a/src/main.py +++ b/src/main.py @@ -20,8 +20,12 @@ if __name__ == '__main__': await client.data.scan_messages( client=client, # limit=50, - days=1, + days=2, ) + # chan = await client.fetch_channel(690588413543579649) + # msg = await chan.fetch_message(936684979654623293) + # logging.info(f'Msg: {msg.clean_content}') + # await msg.reply(f'https://tenor.com/view/i-will-orange-county-jack-black-nodding-nod-gif-4984565') @client.event