Skip to content

Commit

Permalink
migrate meme to folder
Browse files Browse the repository at this point in the history
  • Loading branch information
solumath authored and peterdragun committed Mar 23, 2024
1 parent aea2ec3 commit 902d2c3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
7 changes: 7 additions & 0 deletions cogs/meme/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from disnake.ext.commands import Bot

from .cog import Meme


def setup(bot: Bot):
bot.add_cog(Meme(bot))
19 changes: 8 additions & 11 deletions cogs/meme.py → cogs/meme/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from disnake.ext import commands

from cogs.base import Base
from config.messages import Messages

from .messages_cz import MessagesCZ

uhoh_counter = 0

Expand All @@ -16,6 +17,10 @@ def __init__(self, bot):
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
Expand All @@ -33,20 +38,12 @@ async def on_message(self, message: disnake.Message):
await message.channel.send("uh oh")
uhoh_counter += 1
elif message.content == "PR":
await message.channel.send(Messages.pr_meme)
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(Messages.upgraded_pocitani_caught_deleting)
await pocitani.send(MessagesCZ.upgraded_pocitani_caught_deleting)
await pocitani.send(startnum)

@commands.slash_command(name="uhoh", description=Messages.uhoh_brief)
async def uhoh(self, inter):
await inter.send(Messages.uhoh_counter(uhohs=uhoh_counter))


def setup(bot):
bot.add_cog(Meme(bot))
8 changes: 8 additions & 0 deletions cogs/meme/messages_cz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from config.messages import Messages as GlobalMessages


class MessagesCZ(GlobalMessages):
uhoh_counter = "{uhohs} uh ohs od spuštění."
uhoh_brief = "Vypíše počet uh ohs od spuštění"
uhoh = "uh oh"
pr_meme = "https://github.com/Toaster192/rubbergod/pulls"
7 changes: 0 additions & 7 deletions config/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ class Messages(metaclass=Formatable):
bot_room_redirect = "{user} <:sadcat:576171980118687754> 👉 " \
"<#{bot_room}>\n"

# MEME
uhoh_counter = "{uhohs} uh ohs od spuštění."
uhoh_brief = "Vypíše počet uh ohs od spuštění"
uhoh = "uh oh"

pr_meme = "https://github.com/Toaster192/rubbergod/pulls"

# IOS
ios_brief = "Připomene všem prasatům, že si mají jít po sobě uklidit"
ios_task_start_brief = "Začne pravidelně připomínat všem prasatům, že si mají jít po sobě uklidit"
Expand Down

0 comments on commit 902d2c3

Please sign in to comment.