0
votes

I am trying to edit a channel's name to a variable with text, however, my code doesn't do anything:

@client.command()
async def emoivb(ctx, channel: discord.TextChannel, *, pos):
    await channel.edit(name="Position {info[12]}")

This is the Error I received:

Ignoring exception in command emoivb:
Traceback (most recent call last):
  File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 855, in invoke
    await self.prepare(ctx)
  File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 789, in prepare
    await self._parse_arguments(ctx)
  File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 697, in _parse_arguments
    transformed = await self.transform(ctx, param)
  File "C:\Users\name\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\ext\commands\core.py", line 542, in transform       
    raise MissingRequiredArgument(param)
discord.ext.commands.errors.MissingRequiredArgument: channel is a required argument that is missing.
1
Did you execute the command multiple times? Channel edits are rate limited at 2 edits/10 minutes, so you might not see any reaction because the bot cannot edit the channel at this timeLukas Thaler

1 Answers

0
votes

seems your bot has been rate limited:
https://discord.com/developers/docs/topics/rate-limits

IP addresses that make too many invalid HTTP requests are automatically and temporarily restricted from accessing the Discord API. Currently, this limit is 10,000 per 10 minutes. An invalid request is one that results in 401, 403, or 429 statuses.

For every API request made, we return optional HTTP response headers containing the rate limit encountered during your request.

You should probably decrease your requests to avoid the risk of your IP being restricted.