#HTTP expection: 400 bad data

1 messages · Page 1 of 1 (latest)

hasty blaze
#

I'm getting this error: discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body

But I cant seem to figure out why, the relevant bits of code should be

intents: Intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix=';', case_insensitive=True, help_command=None, intents=intents)


# Setup and handle logging
logger = logging.getLogger('discord')
logger.setLevel(logging.INFO)
handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)```

and 

```@bot.event
async def on_ready():
    # setup task
    @tasks.loop(minutes=1)
    async def activate():
        current_time = datetime.datetime.utcnow().strftime("%H:%M")
        current_date = datetime.datetime.utcnow().strftime("%Y-%m-%d")
        await bot.change_presence(
            activity=discord.Activity(
                type=discord.ActivityType.watching, name=current_date + ", " + current_time))

    # Setup weekly message
    scheduler = AsyncIOScheduler(timezone="UTC")
    scheduler.add_job(func, CronTrigger(day_of_week=0, hour=20))
    # Do on ready events
    print(f'We have logged in as {bot.user}')```
#

I cant seem to figure out what's causing the error.

sharp brook
#

full traceback please

hasty blaze
# sharp brook full traceback please
Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\discord\client.py", line 377, in _run_event
    await coro(*args, **kwargs)
  File "C:\Python311\Lib\site-packages\discord\bot.py", line 1164, in on_connect
    await self.sync_commands()
  File "C:\Python311\Lib\site-packages\discord\bot.py", line 719, in sync_commands
    registered_commands = await self.register_commands(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\discord\bot.py", line 599, in register_commands
    registered = await register("bulk", data, _log=False)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\discord\http.py", line 366, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In 1.name: Must be between 1 and 32 in length.```
sharp brook
#

check the names of all your cmds

hasty blaze
#

oh

sharp brook
hasty blaze
#

found the issue

#

was one of the message_commands where I accidently faceplanted

sharp brook
#

haha

#

.close

trail iceBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @hallow holly.