I found a validation error when the slash command was sent using DM.
Below are the validation error, handler, and discord requests.
Validation Error
2021-11-04T07:05:55.953681+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/dispike/server.py", line 146, in handle_interactions
2021-11-04T07:05:55.953681+00:00 app[web.1]: _parse_to_object = IncomingDiscordSlashInteraction(**_get_request_body)
2021-11-04T07:05:55.953681+00:00 app[web.1]: File "pydantic/main.py", line 406, in pydantic.main.BaseModel.__init__
2021-11-04T07:05:55.953681+00:00 app[web.1]: pydantic.error_wrappers.ValidationError: 2 validation errors for IncomingDiscordSlashInteraction
2021-11-04T07:05:55.953682+00:00 app[web.1]: guild_id
2021-11-04T07:05:55.953682+00:00 app[web.1]: field required (type=value_error.missing)
2021-11-04T07:05:55.953682+00:00 app[web.1]: member
2021-11-04T07:05:55.953682+00:00 app[web.1]: field required (type=value_error.missing)
Handler
@bot.on("verb")
async def handle_verb_request(ctx: IncomingDiscordSlashInteraction) -> DiscordResponse:
Discord Request
{
"application_id": "<cleaned>",
"channel_id": "<cleaned>",
"data": {
"id": "<cleaned>",
"name": "verb",
"type": 1
},
"id": "<cleaned>",
"token": "<cleaned>",
"type": 2,
"user": {
"avatar": "<cleaned>",
"discriminator": "<cleaned>",
"id": "<cleaned>",
"public_flags": 0,
"username": "<cleaned>"
},
"version": 1
}
I found a validation error when the slash command was sent using DM.
Below are the validation error, handler, and discord requests.
Validation Error
Handler
Discord Request
{ "application_id": "<cleaned>", "channel_id": "<cleaned>", "data": { "id": "<cleaned>", "name": "verb", "type": 1 }, "id": "<cleaned>", "token": "<cleaned>", "type": 2, "user": { "avatar": "<cleaned>", "discriminator": "<cleaned>", "id": "<cleaned>", "public_flags": 0, "username": "<cleaned>" }, "version": 1 }