-
Notifications
You must be signed in to change notification settings - Fork 7
/
reactions.py
96 lines (81 loc) · 3.04 KB
/
reactions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import discord
from discord.ext import commands as bot
import os, random, re, asyncio
class Reactions:
"""memes but not"""
def __init__(self, bot):
self.bot = bot
@bot.command()
async def ews(self):
"""disgusting list"""
filenameslist = [os.path.splitext(f)[0] for f in os.listdir("./disgusting")]
await self.bot.say("```"+"\n".join(map(str, filenameslist))+"```")
@bot.command()
async def ew(self,*args):
"""disgusting"""
requested = args
ewlist = {a.lower(): a for a in os.listdir("./disgusting")}
if len(requested) != 0:
maxews = 5
for request in requested:
if maxews == 0: return
else: maxews -= 1
file_extension_or_not_pattern = re.compile('(\.[a-z]+)?$', re.I | re.M)
found = False
for extension in ['.png', '.jpg', '.gif', '.jpeg']:
request_file = file_extension_or_not_pattern.sub(extension, request).lower()
if request_file in ewlist:
found = True
await self.bot.upload("./disgusting/"+ewlist[request_file])
if not found:
await self.bot.say("Use >>ews to see a list of accepted names.")
else:
await self.bot.upload("./disgusting/"+random.choice([a for a in ewlist.values()]))
@bot.command()
async def fuckingincredible(self):
"""fuckingincredible.png"""
await self.bot.say("http://i.imgur.com/yt4hXhJ.png")
@bot.command()
async def crackers(self):
"""jumping boat monkeys!"""
await self.bot.upload("./Holy_crackers.png")
@bot.command()
async def hector(self):
"""judges you"""
await self.bot.upload("./hectorpc.png")
@bot.command()
async def eliwood(self):
""":("""
await self.bot.upload("./eliwoodpc.jpg")
@bot.command()
async def lyn(self):
""">:("""
await self.bot.upload("./lynpc.png")
@bot.command()
async def spritans(self):
"""REEE"""
await self.bot.say("muh")
await asyncio.sleep(1)
await self.bot.say("SPRITANS")
await asyncio.sleep(2)
await self.bot.say("***REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE***")
@bot.command()
async def reee(self):
"""REEEEEEEEEEEEEEEEEEE"""
msg = await self.bot.say("*REEE*")
await asyncio.sleep(0.5)
for i in range(1, random.randint(5,10)):
await asyncio.sleep(0.25)
await self.bot.edit_message(msg, "**REEE" + "E"*i + "**")
await asyncio.sleep(0.25)
await self.bot.edit_message(msg, "***REEE" + "E"*(i+1) + "***")
@bot.command(aliases=["f", 'respects'])
async def F(self):
"""Press F to pay respects."""
await self.bot.upload("./respects.jpeg")
@bot.command()
async def enough(self):
"""you wouldn't like me when i'm angry"""
await self.bot.upload("./enough.png")
def setup(bot):
bot.add_cog(Reactions(bot))