import { SlashClient } from "https://deno.land/x/harmony@v2.9.0/deploy.ts";
Slash Client represents an Interactions Client which can be used without Harmony Client.
Constructors
new
SlashClient(options: SlashOptions)Properties
autocompleteHandlers: AutocompleteHandler[]
optional
client: Clientcommands: ApplicationCommandsManager
handlers: ApplicationCommandHandler[]
modules: ApplicationCommandsModule[]
readonly
rest: RESTManagerMethods
private
_getAutocompleteHandler(i: AutocompleteInteraction): AutocompleteHandler | undefinedGet Handler for an autocomplete Interaction. Supports nested sub commands and sub command groups.
private
_getCommand(i: ApplicationCommandInteraction): ApplicationCommandHandler | undefinedGet Handler for an Interaction. Supports nested sub commands and sub command groups.
_process(interaction: Interaction | ApplicationCommandInteraction): Promise<void>
Process an incoming Interaction
getID(): string
handle(cmd: string, handler: ApplicationCommandHandlerCallback): this
handle(): this
cmd: string,
handler: ApplicationCommandHandlerCallback,
type: ApplicationCommandType | keyof ApplicationCommandType,
verifyFetchEvent(unnamed 0: { respondWith: CallableFunction; request: Request; }): Promise<false | Interaction>
Verify FetchEvent (for Service Worker usage) and return Interaction if valid
verifyKey(): boolean
rawBody: string | Uint8Array,
signature: string | Uint8Array,
timestamp: string | Uint8Array,
Verify HTTP based Interaction
verifyOakRequest<T extends { request: { headers: Headers; hasBody: boolean; body: () => { value: Promise<Uint8Array>; }; }; }>(ctx: T): Promise<boolean>
Method to verify Request from Oak server "Context".
verifyOpineMiddleware<Req extends { headers: Headers; body: Deno.Reader; }, Res extends { setStatus: (code: number) => Res; end: () => Res; }>(): Promise<boolean>
req: Req,
res: Res,
next: CallableFunction,
Middleware to verify request in Opine framework.
verifyOpineRequest<T extends { headers: Headers; body: Deno.Reader; }>(req: T): Promise<boolean>
verifyServerRequest(req: { headers: Headers; method: string; body: Deno.Reader | Uint8Array; respond: (options: { status?: number; headers?: Headers; body?: BodyInit; }) => Promise<void>; }): Promise<false | Interaction>
Verify Deno Std HTTP Server Request and return Interaction.
Data present in Interaction returned by this method is very different from actual typings
as there is no real Client
behind the scenes to cache things.