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

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.

Can someone help ?

See Question&Answers more detail:os

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

1 Answer

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 */
    }
});

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