-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
108 lines (93 loc) · 2.4 KB
/
index.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
declare module "webhooks.js" {
export class Webhook {
constructor(options: WebhookOptions);
send(data: string|object|RichEmbed): Promise<WebhookResponse>;
}
export class RichEmbed {
constructor();
public body: EmbedBody;
pack(): EmbedBody;
setTitle(title: string): this;
setDescription(desc: string): this;
setTimestamp(): this;
setColor(color: number): this;
addField(name: string, value: string, inline: boolean): this;
setImage(url: string): this;
setThumbnail(url: string): this;
setURL(url: string): this;
setFooter(text: string, icon_url: string): this;
setAuthor(name: string, url: string, icon: string): this;
}
interface WebhookResponse {
id: string;
type: number;
content: string;
channel_id: string;
author: MessageAuthor;
attachments: Array<Object>;
embeds: Array<EmbedBody>;
mentions: Array<Object>;
mention_roles: Array<Object>;
pinned: boolean;
mention_everyone: boolean;
tts: boolean;
timestamp: string;
edited_timestamp?: number|null;
flags: number;
webhook_id: string;
}
interface MessageAuthor {
bot: boolean;
id: string;
username: string;
avatar: string;
discriminator: string;
}
interface WebhookOptions {
id: string;
token: string;
}
interface EmbedBody {
title: string;
type: string;
description: string;
url: string;
timestamp: string;
color: number;
footer: EmbedFooter;
image: string;
thumbnail: string;
video: EmbedVideo;
author: EmbedAuthor;
fields: Array<EmbedField>;
}
interface EmbedField {
name: string;
value: string;
inline?: boolean;
}
interface EmbedAuthor {
name: string;
url: string;
icon_url: string;
}
interface EmbedVideo {
url: string;
height: number;
width: number;
}
interface EmbedImage {
url: string;
height: number;
width: number;
}
interface EmbedThumbnail {
url: string;
height: number;
width: number;
}
interface EmbedFooter {
text: string;
icon_url: string;
}
}