Ajout de messages de débogage dans la fonction say_message pour faciliter le suivi des paramètres et du flux d'exécution
This commit is contained in:
parent
9edba884ff
commit
e7d1f899f5
1 changed files with 3 additions and 0 deletions
|
@ -49,15 +49,18 @@ async def say(interaction:discord.Interaction,id:str,message:str):
|
||||||
|
|
||||||
async def say_message(userid:int, guildid:int, shortname:str, message:str,channel:discord.TextChannel):
|
async def say_message(userid:int, guildid:int, shortname:str, message:str,channel:discord.TextChannel):
|
||||||
print("HELLOWORODL")
|
print("HELLOWORODL")
|
||||||
|
print(userid,guildid,shortname,message,channel)
|
||||||
res = await bot.db.execute("SELECT * FROM personnages WHERE uuid=? AND (guild_id=? OR guild_id IS NULL) AND nom_court=?",(userid,guildid,shortname))
|
res = await bot.db.execute("SELECT * FROM personnages WHERE uuid=? AND (guild_id=? OR guild_id IS NULL) AND nom_court=?",(userid,guildid,shortname))
|
||||||
row = await res.fetchone()
|
row = await res.fetchone()
|
||||||
await res.close()
|
await res.close()
|
||||||
if row is None:
|
if row is None:
|
||||||
return False
|
return False
|
||||||
|
print("ok")
|
||||||
short_name = row["nom_court"]
|
short_name = row["nom_court"]
|
||||||
full_name = row["nom_complet"]
|
full_name = row["nom_complet"]
|
||||||
perso_image = row["image"]
|
perso_image = row["image"]
|
||||||
webhook = None
|
webhook = None
|
||||||
|
print("ok2")
|
||||||
if discord.utils.get(await channel.webhooks(),name=short_name) is None:
|
if discord.utils.get(await channel.webhooks(),name=short_name) is None:
|
||||||
webhook = await channel.create_webhook(name=short_name,avatar=perso_image)
|
webhook = await channel.create_webhook(name=short_name,avatar=perso_image)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue