diff options
| author | Fuwn <[email protected]> | 2025-09-24 18:14:30 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-09-24 18:14:30 -0700 |
| commit | 2d987046d094cf5eb784c8d79d678bd3efa5eaf9 (patch) | |
| tree | dd37d395961d9a68e3e1293a89fb46992aab88d1 /packages/interactions/discord/responses.ts | |
| parent | style: Lint (diff) | |
| download | umabotdiscord-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.ts | 15 |
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); + } +} |