【发布时间】:2019-08-01 00:36:42
【问题描述】:
我正在制作一个通过语音识别激活的不和谐机器人,我一开始现在我让他加入一个语音频道(正在工作),我试图发出命令让他离开。
const commando = require('discord.js-commando');
class LeaveChannelCommand extends commando.Command
{
constructor(client){!
super(client,{
name: 'leave',
group: 'music',
memberName: 'leave',
description: 'leaves a voice channel'
});
}
async run(message, args)
{
if(message.guild.voiceConnection)
{
message.guild.voiceConnection.disconnect();
}
else
{
message.channel.sendMessage("seccessfully left")
}
}
}
module.exports = LeaveChannelCommand;
现在你可以在服务器的任何地方输入 !leave 并且机器人离开, 我想让他只能从同一个语音频道控制, 我该怎么办
【问题讨论】:
-
对不起,我不明白你的问题。您想控制机器人将语音通道留在同一语音通道中吗?你能解释一下吗,我会帮你的! :-)
标签: javascript ffmpeg bots discord discord.js