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 | |
| parent | auto overwrite files in ffmpeg (diff) | |
| download | senator-sperma-6c167b73047cfcd1e0a8555904461cd49bd8c395.tar.gz senator-sperma-6c167b73047cfcd1e0a8555904461cd49bd8c395.zip | |
added say command
| -rw-r--r-- | cogs/say.py | 23 | ||||
| -rw-r--r-- | main.py | 1 |
2 files changed, 24 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 | ||
| @@ -40,6 +40,7 @@ if __name__ == "__main__": | |||
| 40 | 'cogs.conversion', | 40 | 'cogs.conversion', |
| 41 | 'cogs.math_cog', | 41 | 'cogs.math_cog', |
| 42 | 'cogs.downloader', | 42 | 'cogs.downloader', |
| 43 | 'cogs.say', | ||
| 43 | 'cogs.music.play', | 44 | 'cogs.music.play', |
| 44 | 'cogs.music.stop', | 45 | 'cogs.music.stop', |
| 45 | 'cogs.music.join', | 46 | 'cogs.music.join', |
