diff options
| author | salmonik <raisersoft@proton.me> | 2025-09-18 15:53:26 +0200 |
|---|---|---|
| committer | salmonik <raisersoft@proton.me> | 2025-09-18 15:53:26 +0200 |
| commit | 6c167b73047cfcd1e0a8555904461cd49bd8c395 (patch) | |
| tree | 2c0390fa56c4a443cea36fc53ce77b07cd785616 /cogs | |
| parent | auto overwrite files in ffmpeg (diff) | |
| download | senator-sperma-6c167b73047cfcd1e0a8555904461cd49bd8c395.tar.gz senator-sperma-6c167b73047cfcd1e0a8555904461cd49bd8c395.zip | |
added say command
Diffstat (limited to '')
| -rw-r--r-- | cogs/say.py | 23 |
1 files changed, 23 insertions, 0 deletions
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 @@ | |||
| 1 | from discord.ext import commands | ||
| 2 | import discord | ||
| 3 | import logging | ||
| 4 | |||
| 5 | logger = logging.getLogger(__name__) | ||
| 6 | |||
| 7 | class Say(commands.Cog): | ||
| 8 | def __init__(self, bot): | ||
| 9 | self.bot = bot | ||
| 10 | |||
| 11 | @discord.slash_command(name="say", description="senator, gadaj") | ||
| 12 | async def say( | ||
| 13 | self, | ||
| 14 | ctx: discord.ApplicationContext, | ||
| 15 | text: str = discord.Option(str, "Tekst do przeczytania", required=True) | ||
| 16 | ): | ||
| 17 | await ctx.defer() | ||
| 18 | await ctx.respond(content="\u200b", ephemeral=True) | ||
| 19 | await ctx.interaction.delete_original_response() | ||
| 20 | await ctx.send(content=text) | ||
| 21 | |||
| 22 | def setup(bot): | ||
| 23 | bot.add_cog(Say(bot)) \ No newline at end of file | ||
