0

This is my code: await message.member.timeout(spamTimeout, 'Recieved a timeout for exceeding max message limit.'); It gives me an error saying:

DiscordAPIError: Missing Permissions

But the bot is the owner of the guild so why would it not have permissions?

  • 1
    I don't think that is possible for a bot to be the owner of a guild. What it might have tried to do is to timeout someone with a role higher than its which caused the error – Caladan Mar 30 '22 at 16:43
  • Probably tried to timeout someone with the same highest role as the bot or a higher role. Or tried to timeout the actual owner. @Caladan yea lol it's actually possible, try client.guilds.create – Staxlinou Mar 30 '22 at 21:18
  • What is the output of this code? `console.log(.me.permissions.bitfield);` (Replace with the guild the bot owns) – Coder Tavi Mar 31 '22 at 09:30
  • @Caladan I would just like to notify you that a bot can be the owner of a guild. Sorry for late reply, my stack overflow was not allowing me to comment (with a script error in the browser console) – Karioton Studios Apr 01 '22 at 07:38

1 Answers1

0

I fixed this myself, the problem was the member I was trying to timeout had ADMINISTRATOR, but you can't be timed out if you have ADMINISTRATOR.

Also I would just like to tell everyone that a bot can be the owner of a guild. Check guild.create();