Files
kwaylon/kwaylon/jokes/jokes.py
2022-01-24 11:55:10 -06:00

108 lines
3.0 KiB
Python

import logging
import re
from nextcord import Client, Message
from nextcord import utils
from . import base, helpers
LOGGER = logging.getLogger(__name__)
# TODO implement new jokes
# - j'accuse
# - egos
# - money is no option
# - we're young, hot, and rich
# - last name page when ordering
# - mcnulty shot and beer
# - white trash karate backflips
# - buc-ees
# - arbys
# - grease 2
# - Sweet Transvestite
# - Hopkins County Stew Contest
# - yesterday tacos
# - strip club
class CumJoke(base.Joke):
@property
def regex(self) -> re.Pattern:
words = [
'come',
'coming',
'came',
'cum',
'cumming',
'cummed'
]
return re.compile(f"(?<!\w)({'|'.join(words)})(?!\w)", re.IGNORECASE)
async def respond(self, message: Message, client: Client, match: re.Match):
if not match.group(0).startswith('be'):
await message.add_reaction(utils.get(client.emojis, name='kaylon'))
class BlackJoke(base.Joke):
@property
def regex(self) -> re.Pattern:
return re.compile('black (\w+)', re.IGNORECASE)
async def respond(self, message: Message, client: Client, match: re.Match):
res = helpers.unblack(message.content)
if res is not None:
msg = await message.reply(res)
await msg.add_reaction(utils.get(client.emojis, name='kaylon'))
class AssJoke(base.Joke):
@property
def regex(self) -> re.Pattern:
return re.compile('[ \-]ass[ \-](?P<target>\w+)', re.IGNORECASE)
async def respond(self, message: Message, client: Client, match: re.Match):
res = helpers.assify(message.content)
if res is not None:
await message.reply(f'{res} {utils.get(client.emojis, name="kaylon")}')
class DominosJoke(base.Joke):
@property
def regex(self) -> re.Pattern:
return re.compile('domino\'?s', re.IGNORECASE)
async def respond(self, message: Message, client: Client, match: re.Match):
cp = helpers.get_stock_price('DPZ')
msg = f'You know, my friend Nick has made about ${cp - 16:.0f} on Domino\'s stock. He basically owns it now'
await message.add_reaction('\U0001F355')
await message.reply(msg)
class BeansJoke(base.GifJoke):
url = 'https://c.tenor.com/TjX1yORoln0AAAAM/this-is-beans-beans.gif'
@property
def regex(self) -> re.Pattern:
return re.compile('beans', re.IGNORECASE)
async def respond(self, message: Message, client: Client, match: re.Match):
await message.reply('Somebody help! I\'ve got beans in my motherboard!\n')
await message.channel.send(self.url)
class NotLikeThisJoke(base.GifJoke):
url = 'https://tenor.com/view/not-like-this-the-matrix-panic-neo-angry-gif-5216157'
@property
def regex(self) -> re.Pattern:
return re.compile('like this', re.IGNORECASE)
class ChiliJoke(base.GifJoke):
url = 'https://tenor.com/view/office-gif-20038284'
@property
def regex(self) -> re.Pattern:
return re.compile('chil(i|ly)', re.IGNORECASE)