mirror of
https://github.com/skylanix/MamieHenriette.git
synced 2026-02-13 03:40:39 +01:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user