summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorCyberL1 <cyber.hf18@gmail.com>2025-10-19 18:41:40 +0200
committerRory& <root@rory.gay>2025-10-19 20:15:47 +0200
commit41bdb5566b1a2dff3b21fac231904aa3690c57a1 (patch)
treee5366f9fc577d3d4ef58854a1786683fe342613b /src/api
parentchore: regenerate `openapi.json` and `schemas.json` (diff)
downloadserver-ts-41bdb5566b1a2dff3b21fac231904aa3690c57a1.tar.xz
fix: interaction context
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/interactions/index.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api/routes/interactions/index.ts b/src/api/routes/interactions/index.ts

index 05571ace..28170d4c 100644 --- a/src/api/routes/interactions/index.ts +++ b/src/api/routes/interactions/index.ts
@@ -53,7 +53,6 @@ router.post("/", route({}), async (req: Request, res: Response) => { app_permissions: "0", // TODO: add this later entitlements: [], authorizing_integration_owners: { "0": req.user_id }, - context: 0, // TODO: add this later attachment_size_limit: 0, // TODO: add this later }; @@ -66,6 +65,7 @@ router.post("/", route({}), async (req: Request, res: Response) => { } if (body.guild_id) { + interactionData.context = 0; interactionData.guild_id = body.guild_id; const guild = await Guild.findOneOrFail({ where: { id: body.guild_id } }); @@ -81,6 +81,12 @@ router.post("/", route({}), async (req: Request, res: Response) => { interactionData.member = member.toPublicMember(); } else { interactionData.user = user.toPublicUser(); + + if (body.channel_id === body.application_id) { + interactionData.context = 1; + } else { + interactionData.context = 2; + } } if (body.type === InteractionType.MessageComponent || body.data.type === InteractionType.ModalSubmit) {