Skip to content Skip to sidebar Skip to footer

Discord.js Guild Specific Command

How would I make a specific command only work in a specific server. What I'm attempting to do: The server: Hello! Thanks for ... . . ! A different server: Blank, unresponsive. Ca

Solution 1:

You can check guild.id. Try reading what parameters the message object has. I think this will help you solve fairly simple questions :)

bot.on('message', message => {
    if ( message.guild.id === 'SOME GUILD ID') {
        /* YOUR CODE HERE */
    }
});

Post a Comment for "Discord.js Guild Specific Command"