做不和谐快捷机器人

时间:2021-01-23 15:33:20

标签: discord.js bots shortcut

我是 discord.py 的新手,我正在编写一个机器人。如您所知,有一个 bot Groovy 用于收听 youtube 视频。我的机器人将用于快捷方式。

const Discord = require ('discord.js');
const client = new Discord.Client();
const prefix = '-';
 
client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();

if(command==='kids'){
    message.channel.send('-p  Kids Cheering - Gaming Sound Effect (HD) ')} });

正如您看到的,每当有人在聊天中写下“-kids”时,bot 都会在聊天中写上“-p Kids Cheering - Gaming Sound Effect (HD)”。但我希望它被 Groovy 读取,以便 groovy 播放它。我试过了,但它不是由 groovy 读取的。我应该怎么办?任何回应将不胜感激。谢谢

1 个答案:

答案 0 :(得分:0)

您不能强制 Groovy 阅读它。默认情况下,机器人不听其他机器人,而且大多数开发人员也不让他们的机器人这样做(例如,为了避免垃圾邮件)。如果 Groovy 不听机器人,你就无法让它听。