fix(interactions): deployment + handler

This commit is contained in:
41666 2021-08-01 16:59:47 -04:00
parent 3ca37cff17
commit 61b1146774
7 changed files with 58 additions and 12 deletions

View file

@ -17,12 +17,12 @@ const commands: Record<
};
export const interactionHandler = async (request: Request): Promise<Response> => {
if (!(await verifyRequest(request))) {
const interaction = (await request.json()) as InteractionRequest;
if (!verifyRequest(request, interaction)) {
return new Response('invalid request signature', { status: 401 });
}
const interaction = (await request.json()) as InteractionRequest;
if (interaction.type === InteractionType.PING) {
return respond({ type: 1 });
}