Modularize bot: per-guild config system for roles/channels/categories
- Add utils/guild_config.py: centralized config loader per guild (data/guilds/{id}.json)
- Add commandes/config.py: /config set_role, /config set_channel, /config set_category, /config voir, /config reset
- Replace ALL hardcoded role IDs (banquier, gouvernement, citoyen, staff, ems, permis, fbm, ursaff, etc.) with guild_config lookups
- Replace ALL hardcoded channel IDs (welcome, candidature, questions, mp_reception) with guild_config lookups
- Replace ALL hardcoded category IDs (ticket) with guild_config lookups
- Remove duplicate commandes/welcome_message.py (kept utils/ version)
- Remove 20+ hardcoded snowflake IDs across 22 files
- Guilds configure via /config on Discord, no code changes needed
This commit is contained in:
parent
bc3cb3f3d5
commit
2e38d05152
25 changed files with 368 additions and 125 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import discord
|
||||
from discord.ext import commands
|
||||
from discord import app_commands
|
||||
from utils.guild_config import get_guild_channel
|
||||
|
||||
class RestranscriptionStaff(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
|
|
@ -18,7 +19,9 @@ class RestranscriptionStaff(commands.Cog):
|
|||
|
||||
# Réceptionner les MPs
|
||||
if isinstance(message.channel, discord.DMChannel):
|
||||
channel_reception = self.bot.get_channel(1277951933105049601) # Remplacez par votre ID de salon
|
||||
channel_reception = get_guild_channel(message.guild, "mp_reception")
|
||||
if channel_reception is None:
|
||||
return
|
||||
|
||||
embed = discord.Embed(description=message.content,
|
||||
color=discord.Color.blue())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue