From d28ca32d1b44dab005569eff3efc4dd0617c6936 Mon Sep 17 00:00:00 2001 From: GZod01 Date: Sun, 15 Dec 2024 17:13:38 +0100 Subject: [PATCH] =?UTF-8?q?Ajoute=20la=20gestion=20des=20messages=20direct?= =?UTF-8?q?s=20dans=20la=20fonction=20say=5Fmessage=20pour=20permettre=20l?= =?UTF-8?q?'envoi=20de=20messages=20dans=20les=20canaux=20priv=C3=A9s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main-bot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main-bot.py b/main-bot.py index 4972217..34dc4ca 100644 --- a/main-bot.py +++ b/main-bot.py @@ -70,6 +70,9 @@ async def say_message(userid:int, guildid:int, shortname:str, message:str,channe # print(short_name,full_name,perso_image) webhook = None # print("ok2") + if type(channel) == type(discord.DMChannel): + await channel.send(f"**{full_name}({short_name})**: {message}") + return if discord.utils.get(await channel.webhooks(),name=short_name) is None: # print("ok3"); webhook = await channel.create_webhook(name=short_name)