From 106e1744d46aebfb1ff068486bde8596630fd0fe Mon Sep 17 00:00:00 2001 From: GZod01 Date: Sun, 15 Dec 2024 16:27:10 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20l'annotation=20de=20type=20pour=20?= =?UTF-8?q?le=20param=C3=A8tre=20message=20dans=20la=20fonction=20on=5Fmes?= =?UTF-8?q?sage=20et=20suppression=20du=20message=20apr=C3=A8s=20l'envoi?= =?UTF-8?q?=20si=20say=5Fmessage=20retourne=20True?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main-bot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main-bot.py b/main-bot.py index 6cea2c5..c7b95bb 100644 --- a/main-bot.py +++ b/main-bot.py @@ -28,7 +28,7 @@ async def on_ready(): @bot.event -async def on_message(message): +async def on_message(message:discord.Message): if message.author.bot: return if message.content.startswith("g!"): @@ -38,7 +38,8 @@ async def on_message(message): uuid = message.author.id guild_id = message.guild.id message_str = message.content.split(" ")[1] - await say_message(uuid,guild_id,short_name,message_str,message.channel) + if await say_message(uuid,guild_id,short_name,message_str,message.channel): + message.delete() @bot.tree.command(name="s",description="Envoyer un message en tant que personnage") async def say(interaction:discord.Interaction,id:str,message:str):