added beans and not like this jokes manually
TODO: convert to joke objects
This commit is contained in:
4
gifs.json
Normal file
4
gifs.json
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"beans": "https://c.tenor.com/TjX1yORoln0AAAAM/this-is-beans-beans.gif",
|
||||||
|
"not like this": "https://tenor.com/view/not-like-this-the-matrix-panic-neo-angry-gif-5216157"
|
||||||
|
}
|
||||||
12
robopage.py
12
robopage.py
@@ -1,6 +1,8 @@
|
|||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
from pathlib import Path
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
@@ -29,6 +31,9 @@ class RoboPage(discord.Client):
|
|||||||
re.IGNORECASE)
|
re.IGNORECASE)
|
||||||
self.leaderboard_regex = re.compile('^most (?P<emoji>\w+) leaderboard$', 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):
|
def run(self):
|
||||||
return super().run(os.getenv('DISCORD_TOKEN'))
|
return super().run(os.getenv('DISCORD_TOKEN'))
|
||||||
|
|
||||||
@@ -68,6 +73,13 @@ class RoboPage(discord.Client):
|
|||||||
except IndexError as e:
|
except IndexError as e:
|
||||||
await message.reply('NObody')
|
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:
|
else:
|
||||||
for joke in self.jokes:
|
for joke in self.jokes:
|
||||||
if (scan_res := joke.scan(message)):
|
if (scan_res := joke.scan(message)):
|
||||||
|
|||||||
Reference in New Issue
Block a user