- Remplace JSON par SQLite (aiosqlite) pour atomicité et intégrité - Nouveau format RIB français avec checksum modulo 97 - Chaque banque a son propre rôle Discord (isolation par serveur) - TVA automatique Particulier -> Entreprise, redirection au Fisc - Institutions gouvernementales avec droit d'audit optionnel - Commandes: /gouv, /banque, /audit, /mes-ribs - Supprime: 16 anciens fichiers (entreprises, FBM, URSAFF, etc.) - Reset complet des données, repart de zéro
44 lines
1.3 KiB
Python
44 lines
1.3 KiB
Python
import discord
|
|
from discord import app_commands
|
|
from discord.ext import commands
|
|
|
|
from utils.bank_manager import BankManager
|
|
|
|
bank_manager = BankManager()
|
|
|
|
|
|
class MesRibs(commands.Cog):
|
|
def __init__(self, bot):
|
|
self.bot = bot
|
|
|
|
@app_commands.command(name="mes-ribs", description="Afficher tous vos RIBs")
|
|
async def mes_ribs(self, interaction: discord.Interaction):
|
|
comptes = await bank_manager.get_comptes_user(interaction.guild.id, interaction.user.id)
|
|
|
|
if not comptes:
|
|
await interaction.response.send_message(
|
|
"❌ Vous n'avez aucun compte bancaire.", ephemeral=True
|
|
)
|
|
return
|
|
|
|
embed = discord.Embed(
|
|
title=f"💳 RIBs de {interaction.user.display_name}",
|
|
color=discord.Color.blue(),
|
|
)
|
|
|
|
for c in comptes:
|
|
tva_text = f" | TVA: {c['tva_rate']}%" if c["account_type"] == "entreprise" else ""
|
|
embed.add_field(
|
|
name=f"{c['bank_name']} ({c['account_type']})",
|
|
value=(
|
|
f"**RIB :** `{c['rib']}`\n"
|
|
f"**Solde :** `{c['solde']:.2f}€`{tva_text}"
|
|
),
|
|
inline=False,
|
|
)
|
|
|
|
await interaction.response.send_message(embed=embed, ephemeral=True)
|
|
|
|
|
|
async def setup(bot):
|
|
await bot.add_cog(MesRibs(bot))
|