added beans and not like this jokes manually

TODO: convert to joke objects
This commit is contained in:
2021-08-13 12:11:09 -05:00
parent de6e5414eb
commit b9b19c2968
2 changed files with 16 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
import json
import logging
import os
import re
from pathlib import Path
from threading import Lock
import discord
@@ -29,6 +31,9 @@ class RoboPage(discord.Client):
re.IGNORECASE)
self.leaderboard_regex = re.compile('^most (?P<emoji>\w+) leaderboard$', re.IGNORECASE)
with Path('gifs.json').open('r') as file:
self.gifs = json.load(file)
def run(self):
return super().run(os.getenv('DISCORD_TOKEN'))
@@ -68,6 +73,13 @@ class RoboPage(discord.Client):
except IndexError as e:
await message.reply('NObody')
elif 'not like this' in message.content.lower():
await message.reply(self.gifs['not like this'])
elif 'beans' in message.content.lower():
await message.reply('Somebody help! I\'ve got beans in my motherboard!\n')
await message.channel.send(self.gifs['beans'])
else:
for joke in self.jokes:
if (scan_res := joke.scan(message)):