Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
799 views
in Technique[技术] by (71.8m points)

discord.js - doing discord shortcut bot

I'm new to discord.py and i'm coding a bot. As you know there is a bot Groovy which is used for listening to youtube videos. And my bot will be used for shortcuts.

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) ')} });

As you see whenever someone write "-kids" on the chat, bot will write "-p Kids Cheering - Gaming Sound Effect (HD)" on the chat. But i want it to be read by Groovy so that groovy plays it. I tried it but it wasn't read by groovy. What should i do? Any reponse will be appreciated. Thank you

question from:https://stackoverflow.com/questions/65861023/doing-discord-shortcut-bot

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can't force Groovy to read it. Bots by default don't listen to other bots, and most devs don't make their bots do that either (to avoid spam, for example). If Groovy doesn't listen to bots, there's nothing you can do to make it listen.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...