danparizher / Pax-Academia

General purpose utility bot for the Homework Help Discord server
MIT License
13 stars 5 forks source link

Error when trying to view an accepted staff application #249

Closed danparizher closed 10 months ago

danparizher commented 10 months ago
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Production code\Pax-Academia\cogs\staffapps_backend.py", line 925, in see_apps
    await ctx.respond(embed=embed.build(), ephemeral=True)
                            ^^^^^^^^^^^^^
  File "C:\Production code\Pax-Academia\message_formatting\embeds.py", line 44, in build
    embed.add_field(name=name[:256], value=value[:1024], inline=inline)
                                           ~~~~~^^^^^^^
TypeError: 'datetime.datetime' object is not subscriptable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "C:\Production code\Pax-Academia\venv\Lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Production code\Pax-Academia\venv\Lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "C:\Production code\Pax-Academia\venv\Lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: TypeError: 'datetime.datetime' object is not subscriptable
sebastiaan-daniels commented 10 months ago

Issue identified:

This only occurs in /see-apps specific-id. The main command /see-apps and all /see-apps subcommand x work fine. This bug occurs because embeds were changed in #199. and fields only accept strings, not datetime objects.