From 51fcdc490d3e731adca3566cb2f9ee45b28c729f Mon Sep 17 00:00:00 2001 From: Samlon Date: Mon, 1 Sep 2025 16:55:09 +0200 Subject: add context commands --- cogs/compression.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cogs/compression.py') diff --git a/cogs/compression.py b/cogs/compression.py index 2ee36bb..db47d46 100644 --- a/cogs/compression.py +++ b/cogs/compression.py @@ -24,6 +24,17 @@ class Compression(commands.Cog): def __init__(self, bot): self.bot = bot + @commands.message_command( + name="kompresja", + description="skompresuj wideło albo dźwienk :)", + ) + async def message_compression(self, ctx, message: discord.Message): + if message.attachments: + for attachment in message.attachments: + await self.compression(ctx, attachment) + else: + await ctx.respond("Brak załączników w wiadomości", ephemeral=True) + @commands.slash_command( name="kompresja", description="skompresuj wideło albo dźwienk :)", -- cgit v1.2.3