<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> body...
const{SlashCommandBuilder}=require('discord.js');module.exports={data:newSlashCommandBuilder().setName('react').setDescription('Replies with reaction!'),asyncexecute(interaction){constmessage=awaitinteraction.reply({content:'You can react with Unicode emojis!',fetchReply:true});awaitmessage.react('...
我在常量值通道和原因中获得了选项,我正在尝试编辑通道权限以锁定通道。这是我当前的命令代码。 const { SlashCommandBuilder ...
DISCORD_CLIENT_ID 디스코드 개발자 포탈에서 등록한 봇의 클라이언트 ID Y DISCORD_GUILD_ID Slash command를 등록할 디스코드 서버의 ID N .env.example 파일을 참고해주세요.About...
guild.id)) ### Wichtige Bot-Einstellungen ### intents = discord.Intents().default() intents.members = True bot = commands.Bot(command_prefix=str(get_prefix), intents=intents) bot.remove_command('help') # slash = SlashCommand(bot, override_type = True, sync_on_cog_reload=True, ...
我也认为@user16 16…方法更简单,但是当您使用SlashCommandBuilder时,您不需要在定义时使用builders子...
const { SlashCommandBuilder } = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('ping') .setDescription('Replies with Pong!'), async execute(interaction) { await interaction.reply("Pong!"); },
@OverridepublicvoidonSlashCommand(SlashCommandEventevent) {if(!event.getName().equals("ping"))return;// make sure we handle the right commandlongtime=System.currentTimeMillis();event.reply("Pong!").setEphemeral(true)// reply or acknowledge.flatMap(v->event.getHook().editOriginalFormat("Pong...
reply("An error occured executing this command. Try again."); } }); // Log in to Discord with your client's token client.login(process.env.TOKEN); 以及我的斜杠命令之一。const { SlashCommandBuilder } = require("@discordjs/builders"); const { MessageEmbed } = require("discord.js");...
我们接下来使用 Discord.js 库的 RESTful API 来注册这个 slash command。在这个实例中,我们使用了 rest-client 库来向 Discord API 发送请求。确保你已经在项目中安装了该库,例如 npm install @discordjs/rest。 如果有多个处理程序(例如,有多个文本频道),则可以为每个处理程序设置不同的 slash 命令。这使你...