added dominos joke
This commit is contained in:
17
robopage.py
17
robopage.py
@@ -5,6 +5,7 @@ import re
|
||||
import discord
|
||||
import nltk
|
||||
import pandas as pd
|
||||
import stockquotes
|
||||
from dotenv import load_dotenv
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
@@ -34,7 +35,8 @@ class RoboPage(discord.Client):
|
||||
self.jokes = [
|
||||
CumJoke(),
|
||||
BlackJoke(),
|
||||
AssJoke()
|
||||
AssJoke(),
|
||||
DominosJoke()
|
||||
]
|
||||
print()
|
||||
|
||||
@@ -141,6 +143,19 @@ class AssJoke(Joke):
|
||||
await message.reply(f'{res} {discord.utils.get(client.emojis, name="kaylon")}')
|
||||
|
||||
|
||||
class DominosJoke(Joke):
|
||||
@property
|
||||
def regex(self) -> re.Pattern:
|
||||
return re.compile('domino\'?s', re.IGNORECASE)
|
||||
|
||||
async def respond(self, message: discord.Message, client: discord.Client, match: re.Match):
|
||||
cp = stockquotes.Stock('DPZ').current_price
|
||||
msg = f'You know, my friend Ben has made about ${cp - 16:.0f} on Domino\'s stock. He basically owns it now'
|
||||
if (e := discord.utils.get(client.emojis, name="pizza")):
|
||||
await message.add_reaction(e)
|
||||
await message.reply(msg)
|
||||
|
||||
|
||||
pattern = 'NP: {<DT>?<JJ>*<NN>}'
|
||||
cp = nltk.RegexpParser(pattern)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user