summaryrefslogtreecommitdiff
path: root/packages/interactions/discord/responses.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-09-24 18:14:30 -0700
committerFuwn <[email protected]>2025-09-24 18:14:30 -0700
commit2d987046d094cf5eb784c8d79d678bd3efa5eaf9 (patch)
treedd37d395961d9a68e3e1293a89fb46992aab88d1 /packages/interactions/discord/responses.ts
parentstyle: Lint (diff)
downloadumabotdiscord-2d987046d094cf5eb784c8d79d678bd3efa5eaf9.tar.xz
umabotdiscord-2d987046d094cf5eb784c8d79d678bd3efa5eaf9.zip
refactor: Move interactions client to packages directory
Diffstat (limited to 'packages/interactions/discord/responses.ts')
-rw-r--r--packages/interactions/discord/responses.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/interactions/discord/responses.ts b/packages/interactions/discord/responses.ts
new file mode 100644
index 0000000..4dcc777
--- /dev/null
+++ b/packages/interactions/discord/responses.ts
@@ -0,0 +1,15 @@
+import type { DiscordResponse } from "./interfaces.ts";
+
+export class JSONResponse extends Response {
+ constructor(body: DiscordResponse | { error: string }, init?: ResponseInit) {
+ const jsonBody = JSON.stringify(body);
+
+ init = init || {
+ headers: {
+ "content-type": "application/json;charset=UTF-8",
+ },
+ };
+
+ super(jsonBody, init);
+ }
+}