0

When I try to use the kick command, it says TypeError: message.author.hasPermission is not a function. I want it to not work if you don't have the permission KICK_MEMBERS. This is my code that is returning the error:

if (!message.author.hasPermission("KICK_MEMBERS")) return;
Kian
  • 3
  • 4

1 Answers1

1

message.author returns a User class, which has no .hasPermission method.

I think you are looking for message.member, which returns a GuildMember.


if (!message.member.hasPermission("KICK_MEMBERS")) return;
Jakye
  • 6,440
  • 3
  • 19
  • 38