darthvader1925
darthvader1925

Reputation: 261

How to only allow a command to be ran by the bot owner (me)

Im working on my discord bot and I have a stop command. The only problem with it is that it can be ran by anyone. I looked at other posts but didn't understand it. Thanks

Upvotes: 0

Views: 281

Answers (1)

DenverCoder9
DenverCoder9

Reputation: 261

Simple, just put this in the beginning of the scope where the command is executed:

if (message.author.id != "<your id here>") return;

Upvotes: 2

Related Questions