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

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...