1 | import { Bot } from '@xene/core';
|
2 | import { SlackbotDispatcher } from './dispatcher';
|
3 | import { Message } from './types';
|
4 | import { Auth, RTM, Chat, Users, Groups, Channels, Files } from './api';
|
5 | export declare class Slackbot extends Bot<string | Message> {
|
6 | static dispatcher: SlackbotDispatcher;
|
7 | static middleware: (handler: (context: {
|
8 | readonly token: string;
|
9 | readonly callbackId: string;
|
10 | readonly responseUrl: string;
|
11 | readonly user: {
|
12 | id: string;
|
13 | name: string;
|
14 | };
|
15 | readonly team: {
|
16 | id: string;
|
17 | domain: string;
|
18 | };
|
19 | readonly channel: {
|
20 | id: string;
|
21 | name: string;
|
22 | };
|
23 | readonly action: {
|
24 | value: string;
|
25 | type: "select" | "button";
|
26 | id: string;
|
27 | };
|
28 | message: Message;
|
29 | ephemeral: string | Message;
|
30 | }) => void | Promise<void>) => (...args: any[]) => Promise<any>;
|
31 | static oauthAccess: typeof Auth.access;
|
32 | id: string;
|
33 | bot: {
|
34 | id: string;
|
35 | name: string;
|
36 | };
|
37 | rtm: RTM;
|
38 | auth: Auth;
|
39 | chat: Chat;
|
40 | users: Users;
|
41 | groups: Groups;
|
42 | channels: Channels;
|
43 | files: Files;
|
44 | constructor(options: {
|
45 | id?: string;
|
46 | botToken: string;
|
47 | appToken?: string;
|
48 | dispatcher?: SlackbotDispatcher;
|
49 | });
|
50 | say(channel: string, message: string | Message): Promise<{
|
51 | channel: string;
|
52 | ts: string;
|
53 | message: Message;
|
54 | }>;
|
55 | listen(): this;
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 | onInteractiveMessage(payload: any): Promise<Message>;
|
62 | |
63 |
|
64 |
|
65 | private onRtmMessage(payload);
|
66 | private markActionSelected(action, attachment);
|
67 | }
|