-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathglobal.d.ts
69 lines (63 loc) · 1.31 KB
/
global.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
interface MinionModule {
key: string,
onMessage: (msg : any) => Iterator<Promise<Object>>,
filter?: (msg : any) => boolean,
requirements?: string[]
}
// it will either have generator field or init field. yes this makes no sense from this perspective
interface ActiveMinion {
generator?: Iterator<Promise<MinionResult>>,
init?: (msg: any) => Iterator<Promise<MinionResult>>,
requirements: string[],
filter: (msg : any) => boolean,
key: string,
contextMatch: (msg : SlackMessage) => boolean
}
interface MinionResult extends Object {
filter?: (msg : any) => boolean,
text?: string,
send?: boolean,
requirements?: string[],
contextMatch?: (msg : SlackMessage) => boolean,
threadReply?: boolean,
channelOverride?: string,
DM?: string
}
interface SlackResponse {
type: string,
channel: string,
user: string,
text: string,
ts: string
}
interface SlackMessage {
id: string,
text: string,
user: SlackUser,
mentions: SlackUser[],
timestamp: Date,
ts: number,
thread_ts?: number,
channel: SlackChannel
}
interface SlackUser {
name: string,
id: string,
profile: {
email: string,
image_original: string,
image_512: string
}
}
interface SlackChannel {
name: string,
id: string,
members: string[],
purpose: {
value: string,
creator: string,
last_set: number
},
is_group: boolean,
is_mpim: boolean
}