-
For example, I wanted to have another bot send a message ("jukebox play url") and jukebox would execute the command the other bot sent. Basically what I'm trying to do is have a GUI app with speech recognition sending these commands to discord through another bot, and then have jukebox reply to these commands. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
You can, but I generally avoid the idea of listening to bot (including own) messages, because it can cause security issues, for example, moderation commands usually check if the user has specific permissions, but when the bot has it and if non-moderators can use the bot to say something, that is a security issue. But if you insist, you can change this statement in to // If the message is bot's own message, return
if (message.author.id !== message.client.user.id || message.channel.type !== "GUILD_TEXT") return message; Or even better, you can exclude this filter to specific bots // If the user is a bot, and not some specific user, return
if ((message.author.bot && message.author.id !== "SOME-ID") || message.channel.type !== "GUILD_TEXT") return message; |
Beta Was this translation helpful? Give feedback.
You can, but I generally avoid the idea of listening to bot (including own) messages, because it can cause security issues, for example, moderation commands usually check if the user has specific permissions, but when the bot has it and if non-moderators can use the bot to say something, that is a security issue.
But if you insist, you can change this statement in
jukebox/src/events/MessageCreateEvent.ts
Line 9 in c77acc1
to
Or even better…