Migration de Kuby vers disnake
This commit is contained in:
parent
dc6e235f27
commit
c8c579eefe
36 changed files with 1205 additions and 1253 deletions
|
|
@ -1,17 +1,14 @@
|
|||
import discord
|
||||
from discord import app_commands
|
||||
from discord.ext import commands
|
||||
import disnake
|
||||
from disnake.ext import commands
|
||||
|
||||
class SentBotMessages(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@app_commands.command(name="sentbotmessages", description="Le bot envoie un message dans un salon choisi.")
|
||||
@app_commands.describe(
|
||||
message="Le message à envoyer",
|
||||
salon="Le salon où envoyer le message"
|
||||
)
|
||||
async def sentbotmessages(self, interaction: discord.Interaction, message: str, salon: discord.TextChannel):
|
||||
@commands.slash_command(name="sentbotmessages", description="Le bot envoie un message dans un salon choisi.")
|
||||
async def sentbotmessages(self, interaction: disnake.ApplicationCommandInteraction,
|
||||
message: str = commands.Param(description="Le message à envoyer"),
|
||||
salon: disnake.TextChannel = commands.Param(description="Le salon où envoyer le message")):
|
||||
# Vérifie si l'utilisateur est admin
|
||||
if not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message("⛔ Tu n'as pas la permission d'utiliser cette commande.", ephemeral=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue