FuseFairy / DiscordBot-EdgeGPT

Using Copilot, Bing Image Creator and DALLE-3 on Discord bot.
GNU General Public License v2.0
158 stars 42 forks source link

Invalid Form Body #67

Closed TerrorSoul closed 1 year ago

TerrorSoul commented 1 year ago

I get the error Invalid Form Body In name: Username cannot contain "discord" when I use the /bing command.

Traceback (most recent call last): File "Python\Python311\site-packages\discord\app_commands\tree.py", line 1248, in _call await command._invoke_with_namespace(interaction, namespace) File "Python\Python311\site-packages\discord\app_commands\commands.py", line 867, in _invoke_with_namespace return await self._do_call(interaction, transformed_values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Python\Python311\site-packages\discord\app_commands\commands.py", line 860, in _do_call raise CommandInvokeError(self, e) from e discord.app_commands.errors.CommandInvokeError: Command 'bing' raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In name: Username cannot contain "discord" [2023-05-05 16:18:26] [ERROR ] discord.app_commands.tree: Ignoring exception in command 'bing' Traceback (most recent call last): File "Python\Python311\site-packages\discord\app_commands\commands.py", line 841, in _do_call return await self._callback(self.binding, interaction, **params) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "E:\Downloads\DiscordBot-EdgeGPT-main\DiscordBot-EdgeGPT-main\cogs\edgegpt.py", line 34, in bing await interaction.response.defer(ephemeral=False, thinking=True) File "Python\Python311\site-packages\discord\interactions.py", line 638, in defer await adapter.create_interactionresponse( File "Python\Python311\site-packages\discord\webhook\async.py", line 221, in request raise HTTPException(response, data) discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In name: Username cannot contain "discord"

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

Traceback (most recent call last): File "Python\Python311\site-packages\discord\app_commands\tree.py", line 1248, in _call await command._invoke_with_namespace(interaction, namespace) File "Python\Python311\site-packages\discord\app_commands\commands.py", line 867, in _invoke_with_namespace return await self._do_call(interaction, transformed_values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "Python\Python311\site-packages\discord\app_commands\commands.py", line 860, in _do_call raise CommandInvokeError(self, e) from e discord.app_commands.errors.CommandInvokeError: Command 'bing' raised an exception: HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In name: Username cannot contain "discord"

`

FuseFairy commented 1 year ago

According to the official documentation of Discord, usernames cannot contain the following substrings: @, #, :, ''', discord.

https://support.discord.com/hc/en-us/community/posts/6881112949911-Username-cannot-contain-discord- https://discord.com/developers/docs/resources/user