aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Matei Pintilie <lucafulger@gmail.com>2021-09-17 19:34:01 +0000
committerLuca Matei Pintilie <lucafulger@gmail.com>2021-09-17 19:34:01 +0000
commit93017e8050842b46a5721545efe9ea53e21fe5a4 (patch)
tree3f3a1f6ed7b79b8d8b5a0f8b0a35cc5b694836cc
parent083316305d51697ae7ced4e60786e7282ea86a69 (diff)
downloadspeedrunbot-slash-93017e8050842b46a5721545efe9ea53e21fe5a4.tar
speedrunbot-slash-93017e8050842b46a5721545efe9ea53e21fe5a4.tar.gz
speedrunbot-slash-93017e8050842b46a5721545efe9ea53e21fe5a4.tar.bz2
speedrunbot-slash-93017e8050842b46a5721545efe9ea53e21fe5a4.tar.lz
speedrunbot-slash-93017e8050842b46a5721545efe9ea53e21fe5a4.tar.xz
speedrunbot-slash-93017e8050842b46a5721545efe9ea53e21fe5a4.tar.zst
speedrunbot-slash-93017e8050842b46a5721545efe9ea53e21fe5a4.zip
More debugging
-rw-r--r--src/pages/api/discord/interactions.ts11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/pages/api/discord/interactions.ts b/src/pages/api/discord/interactions.ts
index 4c854d1..37c4aa8 100644
--- a/src/pages/api/discord/interactions.ts
+++ b/src/pages/api/discord/interactions.ts
@@ -42,20 +42,12 @@ export default async (req: Request): Promise<Response> => {
if (signature === null || timestamp === null) return bad;
const verify = await client.verifyKey(rawbody, signature, timestamp);
-
- console.log(
- verify,
- new TextDecoder().decode(rawbody),
- signature,
- timestamp,
- );
-
if (!verify) return bad;
let res: ApplicationCommandInteraction | Interaction;
try {
const payload: InteractionPayload = JSON.parse(decodeText(rawbody));
-
+ console.log(payload);
if (payload.type === InteractionType.APPLICATION_COMMAND) {
res = new ApplicationCommandInteraction(client as any, payload, {
user: new User(
@@ -84,6 +76,7 @@ export default async (req: Request): Promise<Response> => {
channel: payload.channel_id as any,
});
}
+ console.log(res);
await client.emit("interaction", res);
return new Response(res instanceof FormData ? res : JSON.stringify(res), {
status: 200,