-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
index.d.ts
137 lines (118 loc) · 3.85 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
declare module "webhook-discord" {
export class Webhook {
constructor(url: string, nowait?: boolean);
/**
* @param {string} name The username of the success webhook.
* @param {string} message The message of the success webhook.
*/
public success(name: string, message: string): void;
/**
* @param {string} name The username of the info webhook.
* @param {string} message The message of the info webhook.
*/
public info(name: string, message: string): void;
/**
* @param {string} name The username of the error webhook.
* @param {string} message The message of the error webhook.
*/
public err(name: string, message: string): void;
/**
* @param {string} name The username of the warning webhook.
* @param {string} message The message of the warning webhook.
*/
public warn(name: string, message: string): void;
/**
* This method is used to send a MessageBuilder to the webhook.
*
* @param {MessageBuilder} messageBuilder The message.
*/
public send(messageBuilder: MessageBuilder): Promise<undefined>;
}
// tslint:disable-next-line:max-classes-per-file
export class MessageBuilder {
constructor();
/**
* Add an avatar to the webhooks
*
* @param {string} avatarURL The URL to the avatar.
*/
public setAvatar(avatarURL: string): MessageBuilder;
/**
* This method sets the username of the hook
*
* @param {string} username The username to use
*/
public setName(username: string): MessageBuilder;
/**
* Set the footer of the embed
*
* @param {string} footer The footer to use
* @param {string} footerIcon The icon to display in the footer
*/
public setFooter(footer: string, footerIcon: string): MessageBuilder;
/**
* Set the description of the embed
*
* @param {string} description The description to use
*/
public setDescription(description: string): MessageBuilder;
/**
* Set the text to be sent alongside the embed.
*
* @param {string} text The text.
*/
public setText(text: string): MessageBuilder;
/**
* This method adds a new field to the embed.
*
* @param {string} title The title of the field.
* @param {string} value The value of the field.
* @param {bool} inline Should the field be an inline field
*/
public addField(title: string, value: string, inline?: boolean): MessageBuilder;
/**
* This method adds an image to the embed.
*
* @param {string} imageURL The URL to the image.
*/
public setImage(imageURL: string): MessageBuilder;
/**
* Set timestamp, if no argument is passed, the current
* time is used.
*
* @param {number} timestamp The timestamp to use.
*/
public setTime(timestamp?: number): MessageBuilder;
/**
* Set the title of the embed
*
* @param {string} title The title to use
*/
public setTitle(title: string): MessageBuilder;
/**
* Set the author of the embed
* @param {string} author Name of the author
* @param {string} iconURL Optional: Icon URL of the author
* @param {string} url Optional: Link to the author
*/
public setAuthor(author: string, iconURL?: string, url?: string): MessageBuilder;
/**
* Set the URL for the Discord embed
*
* @param {string} url The URL to link to from the embed.
*/
public setURL(url: string): MessageBuilder;
/**
* This method sets the color of the embed.
*
* @param {string} color The hexadecimal color
*/
public setColor(color: string): MessageBuilder;
/**
* This method adds a thumbnail to the embed.
*
* @param {string} thumbnailURL The URL to the thumbnail.
*/
public setThumbnail(thumbnailURL: string): MessageBuilder;
}
}