diff --git a/money_commands.py b/money_commands.py index 900dbb1..7fceb65 100644 --- a/money_commands.py +++ b/money_commands.py @@ -29,8 +29,8 @@ class MoneyCommands(app_commands.Group): self.bot=bot @app_commands.command(name="donner",description="Donne de l'argent à un autre personnage") - @app_commands.describe(amount="Le montant à donner",from_short_name="Le personnage depuis lequel prendre l'argent",to_short_name="Le personnage à qui donner l'argent") - async def give_money(self,interaction:discord.Interaction,amount:int,from_short_name:str,to_short_name:str): + @app_commands.describe(amount="Le montant à donner",from_short_name="Le personnage depuis lequel prendre l'argent",to_short_name="Le personnage à qui donner l'argent",secret="Si l'opération doit être secrète") + async def give_money(self,interaction:discord.Interaction,amount:int,from_short_name:str,to_short_name:str,secret=True): if amount<=0: await interaction.response.send_message("Le montant doit être positif",ephemeral=True) return @@ -50,16 +50,16 @@ class MoneyCommands(app_commands.Group): await self.bot.db.execute("UPDATE personnages SET money=money-? WHERE nom_court=?", (amount,from_short_name)) await self.bot.db.execute("UPDATE personnages SET money=money+? WHERE nom_court=?", (amount,to_short_name)) await self.bot.db.commit() - await interaction.response.send_message(f"Vous avez donné {amount} pièces à {to_short_name}",ephemeral=True) + await interaction.response.send_message(f"{from_short_name} vient de donner {amount} pièces à {to_short_name}",ephemeral=not secret) @app_commands.command(name="voir",description="Voir votre solde ou le solde d'un autre personnage") - @app_commands.describe(short_name="Le personnage dont vous voulez voir le solde") - async def see_money(self,interaction:discord.Interaction,short_name:str): + @app_commands.describe(short_name="Le personnage dont vous voulez voir le solde",secret="Si l'opération doit être secrète") + async def see_money(self,interaction:discord.Interaction,short_name:str,secret=True): check_exist = await self.bot.db.execute("SELECT money FROM personnages WHERE nom_court=?", (short_name,)) money = await check_exist.fetchone() if money is None: await interaction.response.send_message("Ce personnage n'existe pas",ephemeral=True) return - await interaction.response.send_message(f"{short_name} a {money['money']} pièces",ephemeral=True) + await interaction.response.send_message(f"{short_name} a {money['money']} pièces",ephemeral=not secret) @app_commands.command(name="admin_ajouter",description="Ajoute de l'argent à un personnage") @app_commands.describe(amount="Le montant à ajouter",short_name="Le personnage à qui ajouter l'argent")