Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate meme to folder #921

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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