sravan1946 / sravan-cogs

Some random cogs made by me for my bot made using Red-DiscordBot
MIT License
5 stars 10 forks source link

[timeout] Forbidden error when tt or utt a user if they have a role higher than the bot #24

Closed NoobInDaHause closed 1 year ago

NoobInDaHause commented 1 year ago
Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/ubuntu/.local/share/Red-DiscordBot/data/BaconMan/cogs/CogManager/cogs/timeout/timeout.py", line 190, in timeout
    await self.timeout_user(ctx, member_or_role, time, reason)
  File "/home/ubuntu/.local/share/Red-DiscordBot/data/BaconMan/cogs/CogManager/cogs/timeout/timeout.py", line 92, in timeout_user
    await ctx.bot.http.request(r, json=payload, reason=reason)
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/http.py", line 248, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/ubuntu/redenv/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
sravan1946 commented 1 year ago

I will be doing a small rewrite of the timeout cog for the dpy2 branch and this should be fixed there

NoobInDaHause commented 1 year ago

looking forward to it

sravan1946 commented 1 year ago

should be fixed now