From 6c167b73047cfcd1e0a8555904461cd49bd8c395 Mon Sep 17 00:00:00 2001 From: salmonik Date: Thu, 18 Sep 2025 15:53:26 +0200 Subject: added say command --- cogs/say.py | 23 +++++++++++++++++++++++ main.py | 1 + 2 files changed, 24 insertions(+) create mode 100644 cogs/say.py diff --git a/cogs/say.py b/cogs/say.py new file mode 100644 index 0000000..93f04f4 --- /dev/null +++ b/cogs/say.py @@ -0,0 +1,23 @@ +from discord.ext import commands +import discord +import logging + +logger = logging.getLogger(__name__) + +class Say(commands.Cog): + def __init__(self, bot): + self.bot = bot + + @discord.slash_command(name="say", description="senator, gadaj") + async def say( + self, + ctx: discord.ApplicationContext, + text: str = discord.Option(str, "Tekst do przeczytania", required=True) + ): + await ctx.defer() + await ctx.respond(content="\u200b", ephemeral=True) + await ctx.interaction.delete_original_response() + await ctx.send(content=text) + +def setup(bot): + bot.add_cog(Say(bot)) \ No newline at end of file diff --git a/main.py b/main.py index caa58d2..708e04f 100644 --- a/main.py +++ b/main.py @@ -40,6 +40,7 @@ if __name__ == "__main__": 'cogs.conversion', 'cogs.math_cog', 'cogs.downloader', + 'cogs.say', 'cogs.music.play', 'cogs.music.stop', 'cogs.music.join', -- cgit v1.2.3