Derock
Derock

Reputation: 323

How can I check if a user is a bot?

I am making a Discord bot and I am using the event guildMemberAdd like this:

bot.on("guildMemberAdd", function(member) {

});

How can I check if the member is a bot or not?

Upvotes: 5

Views: 13404

Answers (1)

user247702
user247702

Reputation: 24212

member is of type GuildMember and has a user property of type User, which has a boolean bot property to indicate whether or not the user is a bot. So member.user.bot will tell you if the added member is a bot.

Upvotes: 9

Related Questions