【发布时间】:2022-01-25 17:53:26
【问题描述】:
我希望命令做的就是说出我们希望机器人说的话。
示例:/echo 测试
并且机器人应该响应:测试
但我不知道该怎么做
这是我的代码:
const { SlashCommandBuilder, SlashCommandStringOption } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('echo')
.setDescription('Replies with your input!')
.addStringOption(option =>
option.setName('input')
.setDescription('The input to echo back')
.setRequired(true)),
async execute(interaction) {
await interaction.send(input)
},
};
【问题讨论】:
标签: node.js discord.js slash