diff --git a/main-bot.py b/main-bot.py index 97409fe..29c18f5 100644 --- a/main-bot.py +++ b/main-bot.py @@ -42,8 +42,10 @@ async def on_message(message): @bot.tree.command(name="s",description="Envoyer un message en tant que personnage") async def say(interaction:discord.Interaction,id:str,message:str): if not await say_message(interaction.user.id,interaction.guild.id,id,message,interaction.channel): + print("ok9") await interaction.response.send_message("Vous n'avez pas ce personnage",ephemeral=True) return + print("ok10") await interaction.response.send_message("Message envoyé",ephemeral=True) @@ -63,10 +65,16 @@ async def say_message(userid:int, guildid:int, shortname:str, message:str,channe webhook = None print("ok2") if discord.utils.get(await channel.webhooks(),name=short_name) is None: + print("ok3"); webhook = await channel.create_webhook(name=short_name,avatar=perso_image) + print("ok4") else: + print("ok5") webhook = discord.utils.get(await channel.webhooks(),name=short_name) + print("ok6") + print("ok7") await webhook.send(message,username=full_name,avatar_url=perso_image) + print("ok8") return True bot.run(bot_token) \ No newline at end of file