-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.d.ts
190 lines (167 loc) · 5.12 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
export { }
declare global {
interface QueryMap {
[key: string]: string;
}
interface User {
id: string;
username: string;
global_name?: string;
avatar?: string;
accent_color?: number;
bot: boolean;
}
interface Member {
user: User;
code?: string;
invitedBy?: string;
avatar?: string;
nick?: string;
joined_at: string;
permissions?: string;
}
interface InvitedMember {
user: User;
code: string;
invitedBy: string;
}
interface ActualMemberDTO {
user: User;
joined_at: string;
avatar?: string;
nick?: string;
}
interface MemberDTO {
source_invite_code?: string;
join_source_type?: number;
inviter_id?: string;
member: ActualMemberDTO;
}
interface MemberSearchDTO {
guild_id: string;
members: MemberDTO[];
page_result_count: number;
total_result_count: number;
}
interface InviteDTO {
code: string;
inviter?: User;
}
interface Invite {
code: string;
user?: User;
}
interface InviterMember {
userId: string;
mention: string;
membersJoinedCount: number;
}
interface MessageCreateResponseDTO {
id: string;
channel_id: string;
}
interface GetMessagesQuery {
[key: string]: string | number | undefined;
limit?: number;
before?: string;
around?: string;
after?: string;
}
interface Embed {
title?: string;
type?: "rich" | "image" | "video" | "gifv" | "article" | "link"; // type will always be "rich" for webhook embeds
description?: string;
url?: string;
timestamp?: string;
color?: number;
footer?: EmbedFooter;
image?: EmbedImage;
thumbnail?: EmbedThumbnail;
video?: EmbedVideo;
provider?: EmbedProvider;
author?: EmbedAuthor;
fields?: EmbedField[];
}
interface EmbedFooter {
text: string;
icon_url?: string;
proxy_icon_url?: string;
}
interface EmbedImage {
url: string;
proxy_url?: string;
height?: number;
width?: number;
}
interface EmbedThumbnail {
url: string;
proxy_url?: string;
height?: number;
width?: number;
}
interface EmbedVideo {
url?: string;
proxy_url?: string;
height?: number;
width?: number;
}
interface EmbedProvider {
name?: string;
url?: string;
}
interface EmbedAuthor {
name: string;
url?: string;
icon_url?: string;
proxy_icon_url?: string;
}
interface EmbedField {
name: string;
value: string;
inline?: boolean;
}
interface Template {
template: string;
type: "seq" | "random";
maxMembersCount?: number;
min?: number;
content?: string;
embeds?: Embed[];
}
interface Message {
id: string; // id of the message
channel_id: string; // id of the channel the message was sent in
author?: User; // the author of this message (not guaranteed to be a valid user)
content?: string; // contents of the message
timestamp: string; // ISO8601 timestamp when this message was sent
edited_timestamp?: string; // ISO8601 timestamp when this message was edited (or null if never)
tts: boolean; // whether this was a TTS message
mention_everyone: boolean; // whether this message mentions everyone
mentions: User[]; // users specifically mentioned in the message
mention_roles: string[]; // roles specifically mentioned in this message
// mention_channels?: ChannelMention[]; // channels specifically mentioned in this message
// attachments?: Attachment[]; // any attached files
embeds?: Embed[]; // any embedded content
// reactions?: Reaction[]; // reactions to the message
nonce?: number | string; // used for validating a message was sent
pinned: boolean; // whether this message is pinned
webhook_id?: string; // if the message is generated by a webhook, this is the webhook's id
type: number; // type of message
// activity?: MessageActivity; // sent with Rich Presence-related chat embeds
// application?: Partial<Application>; // sent with Rich Presence-related chat embeds
application_id?: string; // if the message is an Interaction or application-owned webhook, this is the id of the application
// message_reference?: MessageReference; // data showing the source of a crosspost, channel follow add, pin, or reply message
flags?: number; // message flags combined as a bitfield
referenced_message?: Message; // the message associated with the message_reference
interaction_metadata?: any; // In preview. Sent if the message is sent as a result of an interaction
interaction?: any; // Deprecated in favor of interaction_metadata; sent if the message is a response to an interaction
thread?: any; // the thread that was started from this message, includes thread member object
components?: any[]; // sent if the message contains components like buttons, action rows, or other interactive components
sticker_items?: any[]; // sent if the message contains stickers
stickers?: any[]; // Deprecated the stickers sent with the message
position?: number; // A generally increasing integer that represents the approximate position of the message in a thread
role_subscription_data?: any; // data of the role subscription purchase or renewal that prompted this ROLE_SUBSCRIPTION_PURCHASE message
resolved?: any; // data for users, members, channels, and roles in the message's auto-populated select menus
poll?: any; // A poll!
}
}