From 4abc4e20b52dbff7cb228817d284fc12db585048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Mogu=C3=A9rou?= Date: Sun, 17 Dec 2023 23:42:49 +0100 Subject: [PATCH] =?UTF-8?q?Le=20channel=20par=20d=C3=A9faut=20est=20le=20c?= =?UTF-8?q?hannel=20de=20l'interaction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cogs/cog_fun.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cogs/cog_fun.py b/cogs/cog_fun.py index aa8c09e..3893bd3 100644 --- a/cogs/cog_fun.py +++ b/cogs/cog_fun.py @@ -13,7 +13,7 @@ class Fun(MyCog): self.bot = bot @app_commands.command(name="chuchoter") - async def chuchoter(self, interaction: discord.Interaction, channel: discord.TextChannel, message: str): + async def chuchoter(self, interaction: discord.Interaction, message: str, channel: discord.TextChannel=None): """ Chuchote à Staticky un message qu'il partagera (attention ne lui faites pas aveuglément confiance) :param interaction: discord interaction @@ -21,6 +21,9 @@ class Fun(MyCog): :param message: Message à partagerE """ try: + if channel is None: + channel = interaction.channel + to_send = f"**Quelqu'un m'a chuchoté :** \"{message}\"" if random.randint(1, 6) == 1: to_send += f"\nJe balance, c'est {interaction.user.mention} !"