Ajouter un modèle d'avertissement et des fonctionnalités de modération

Ajout d'un nouveau modèle Warning dans database/models.py pour suivre les avertissements donnés aux utilisateurs.
Mise à jour de database/schema.sql pour créer la table correspondante 'warning'.
Amélioration du bot Discord pour gérer les commandes d'avertissement.
Ajout d'une route de modération dans webapp pour de futures fonctionnalités de modération.
Mise à jour de template.html pour inclure un lien vers la page de modération.
This commit is contained in:
Mow
2025-10-14 22:37:28 +02:00
parent 22abbcb02d
commit aff236fd0c
8 changed files with 111 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ from database.helpers import ConfigurationHelper
from database.models import Configuration, Humeur, Commande
from discord import Message, TextChannel
from discordbot.humblebundle import checkHumbleBundleAndNotify
from discordbot.command import handle_warning_command
from protondb import searhProtonDb
class DiscordBot(discord.Client):
@@ -63,6 +64,12 @@ async def on_message(message: Message):
if not message.content.startswith('!'):
return
command_name = message.content.split()[0]
if command_name in ['!averto', '!av', '!avertissement', '!warn']:
await handle_warning_command(message, bot)
return
commande = Commande.query.filter_by(discord_enable=True, trigger=command_name).first()
if commande:
try: