-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathcog.py
50 lines (39 loc) · 1.6 KB
/
cog.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
"""
Cog for meme commands.
"""
import disnake
from disnake.ext import commands
from cogs.base import Base
from rubbergod import Rubbergod
from .messages_cz import MessagesCZ
uhoh_counter = 0
class Meme(Base, commands.Cog):
def __init__(self, bot: Rubbergod):
super().__init__()
self.bot = bot
@commands.slash_command(name="uhoh", description=MessagesCZ.uhoh_brief)
async def uhoh(self, inter: disnake.ApplicationCommandInteraction):
await inter.send(MessagesCZ.uhoh_counter(uhohs=uhoh_counter))
@commands.Cog.listener()
async def on_message(self, message: disnake.Message):
global uhoh_counter
if message.author.bot:
if (
message.author.id in self.config.grillbot_ids
and message.content.startswith("<:")
and message.content.endswith(">")
):
await message.channel.send(message.content)
return
elif self.config.uhoh_string in message.content.lower():
await message.channel.send("uh oh")
uhoh_counter += 1
elif message.content == "PR":
await message.channel.send(MessagesCZ.pr_meme)
@commands.Cog.listener()
async def on_raw_message_delete(self, payload: disnake.RawMessageDeleteEvent):
if payload.channel_id == self.config.upgraded_pocitani_thread_id:
pocitani = self.bot.get_channel(payload.channel_id)
startnum = self.config.upgraded_pocitani_start_num
await pocitani.send(MessagesCZ.upgraded_pocitani_caught_deleting)
await pocitani.send(startnum)