From 4103bda89fc41a22af12f14328dcf825c3945971 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Mon, 10 Feb 2025 15:34:02 +0000 Subject: [PATCH] feat: add authenticatorHeader helper --- src/Client.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Client.ts b/src/Client.ts index 7e90e61b..994bdad1 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -286,6 +286,15 @@ export class Client extends EventEmitter { return typeof this.#session === "string" ? undefined : this.#session?._id; } + /** + * Get authentication header + */ + get authenticationHeader() { + return typeof this.#session === "string" + ? ["X-Bot-Token", this.#session] + : ["X-Session-Token", this.#session?.token as string]; + } + /** * Connect to Revolt */