Beta/commandes/autres/setwelcomechannel.py

16 lines
624 B
Python
Raw Permalink Normal View History

2026-02-06 22:23:20 +01:00
import discord
from .config import config
async def execute(bot, params, message):
channel_name = params.get('channel_name')
2026-06-16 17:09:34 +00:00
if not channel_name:
await message.channel.send("Veuillez spécifier un nom de salon.")
return
2026-02-06 22:23:20 +01:00
guild = message.guild
channel = discord.utils.find(lambda c: c.name.casefold() == channel_name.casefold(), guild.channels)
if not channel:
await message.channel.send(f"Salon '{channel_name}' introuvable.")
return
config.set_welcome_channel(guild.id, channel.id)
await message.channel.send(f"Salon de bienvenue défini sur {channel.mention}.")