n-slack
Version:
NestJS Slack Plugin
17 lines (16 loc) • 666 B
TypeScript
import type { ChatPostMessageArguments, WebClient } from "@slack/web-api";
import { Channels } from ".";
import type { SlackConfig } from "./types";
export type SlackMessageOptions<C> = ChatPostMessageArguments & {
channel: C;
};
export declare class SlackService<C = Channels> {
private readonly options;
readonly client: WebClient | null;
constructor(options: SlackConfig, client: WebClient | null);
sendText(text: SlackMessageOptions<C>["text"], opts: SlackMessageOptions<C>): Promise<void>;
postMessage(req: SlackMessageOptions<C>): Promise<void>;
private runApiRequest;
private runWebhookRequest;
private runStdoutRequest;
}