@koishijs/plugin-adapter-discord 2.1.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,404 +0,0 @@
1
- import { AllowedMentions, Application, Channel, Component, GuildMember, integer, MessageInteraction, Reaction, snowflake, Sticker, timestamp, User } from '.';
2
- /** https://discord.com/developers/docs/resources/channel#message-object-message-structure */
3
- export interface Message {
4
- /** id of the message */
5
- id: snowflake;
6
- /** id of the channel the message was sent in */
7
- channel_id: snowflake;
8
- /** id of the guild the message was sent in */
9
- guild_id?: snowflake;
10
- /** the author of this message (not guaranteed to be a valid user, see below) */
11
- author: User;
12
- /** member properties for this message's author */
13
- member?: Partial<GuildMember>;
14
- /** contents of the message */
15
- content: string;
16
- /** when this message was sent */
17
- timestamp: timestamp;
18
- /** when this message was edited (or null if never) */
19
- edited_timestamp?: timestamp;
20
- /** whether this was a TTS message */
21
- tts: boolean;
22
- /** whether this message mentions everyone */
23
- mention_everyone: boolean;
24
- /** users specifically mentioned in the message */
25
- mentions: User[];
26
- /** roles specifically mentioned in this message */
27
- mention_roles: snowflake[];
28
- /** channels specifically mentioned in this message */
29
- mention_channels?: ChannelMention[];
30
- /** any attached files */
31
- attachments: Attachment[];
32
- /** any embedded content */
33
- embeds: Embed[];
34
- /** reactions to the message */
35
- reactions?: Reaction[];
36
- /** used for validating a message was sent */
37
- nonce?: integer | string;
38
- /** whether this message is pinned */
39
- pinned: boolean;
40
- /** if the message is generated by a webhook, this is the webhook's id */
41
- webhook_id?: snowflake;
42
- /** type of message */
43
- type: Message.Type;
44
- /** sent with Rich Presence-related chat embeds */
45
- activity?: Message.Activity;
46
- /** sent with Rich Presence-related chat embeds */
47
- application?: Partial<Application>;
48
- /** if the message is a response to an Interaction, this is the id of the interaction's application */
49
- application_id?: snowflake;
50
- /** data showing the source of a crosspost, channel follow add, pin, or reply message */
51
- message_reference?: Message.Reference;
52
- /** message flags combined as a bitfield */
53
- flags?: integer;
54
- /** the message associated with the message_reference */
55
- referenced_message?: Message;
56
- /** sent if the message is a response to an Interaction */
57
- interaction?: MessageInteraction;
58
- /** the thread that was started from this message, includes thread member object */
59
- thread?: Channel;
60
- /** sent if the message contains components like buttons, action rows, or other interactive components */
61
- components?: Component[];
62
- /** sent if the message contains stickers */
63
- sticker_items?: Sticker.Item[];
64
- }
65
- export declare namespace Message {
66
- /** https://discord.com/developers/docs/resources/channel#message-object-message-types */
67
- enum Type {
68
- DEFAULT = 0,
69
- RECIPIENT_ADD = 1,
70
- RECIPIENT_REMOVE = 2,
71
- CALL = 3,
72
- CHANNEL_NAME_CHANGE = 4,
73
- CHANNEL_ICON_CHANGE = 5,
74
- CHANNEL_PINNED_MESSAGE = 6,
75
- GUILD_MEMBER_JOIN = 7,
76
- USER_PREMIUM_GUILD_SUBSCRIPTION = 8,
77
- USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 = 9,
78
- USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 = 10,
79
- USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 = 11,
80
- CHANNEL_FOLLOW_ADD = 12,
81
- GUILD_DISCOVERY_DISQUALIFIED = 14,
82
- GUILD_DISCOVERY_REQUALIFIED = 15,
83
- GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING = 16,
84
- GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING = 17,
85
- THREAD_CREATED = 18,
86
- REPLY = 19,
87
- CHAT_INPUT_COMMAND = 20,
88
- THREAD_STARTER_MESSAGE = 21,
89
- GUILD_INVITE_REMINDER = 22,
90
- CONTEXT_MENU_COMMAND = 23
91
- }
92
- /** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
93
- interface Activity {
94
- /** type of message activity */
95
- type: ActivityType;
96
- /** party_id from a Rich Presence event */
97
- party_id?: string;
98
- }
99
- /** https://discord.com/developers/docs/resources/channel#message-object-message-activity-types */
100
- enum ActivityType {
101
- JOIN = 1,
102
- SPECTATE = 2,
103
- LISTEN = 3,
104
- JOIN_REQUEST = 5
105
- }
106
- /** https://discord.com/developers/docs/resources/channel#message-object-message-flags */
107
- enum Flag {
108
- /** this message has been published to subscribed channels (via Channel Following) */
109
- CROSSPOSTED = 1,
110
- /** this message originated from a message in another channel (via Channel Following) */
111
- IS_CROSSPOST = 2,
112
- /** do not include any embeds when serializing this message */
113
- SUPPRESS_EMBEDS = 4,
114
- /** the source message for this crosspost has been deleted (via Channel Following) */
115
- SOURCE_MESSAGE_DELETED = 8,
116
- /** this message came from the urgent message system */
117
- URGENT = 16,
118
- /** this message has an associated thread, with the same id as the message */
119
- HAS_THREAD = 32,
120
- /** this message is only visible to the user who invoked the Interaction */
121
- EPHEMERAL = 64,
122
- /** this message is an Interaction Response and the bot is "thinking" */
123
- LOADING = 128
124
- }
125
- /** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */
126
- interface Reference {
127
- /** id of the originating message */
128
- message_id?: snowflake;
129
- /** id of the originating message's channel */
130
- channel_id?: snowflake;
131
- /** id of the originating message's guild */
132
- guild_id?: snowflake;
133
- /** when sending, whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true */
134
- fail_if_not_exists?: boolean;
135
- }
136
- /** https://discord.com/developers/docs/resources/channel#get-channel-messages-query-string-params */
137
- interface GetParams {
138
- /** get messages around this message ID */
139
- around?: snowflake;
140
- /** get messages before this message ID */
141
- before?: snowflake;
142
- /** get messages after this message ID */
143
- after?: snowflake;
144
- /** max number of messages to return (1-100) */
145
- limit?: integer;
146
- }
147
- /** https://discord.com/developers/docs/resources/channel#create-message-jsonform-params */
148
- interface CreateParams extends EditParams {
149
- /** true if this is a TTS message */
150
- tts: boolean;
151
- /** include to make your message a reply */
152
- message_reference: Reference;
153
- /** IDs of up to 3 stickers in the server to send in the message */
154
- sticker_ids: snowflake[];
155
- }
156
- /** https://discord.com/developers/docs/resources/channel#edit-message-jsonform-params */
157
- interface EditParams {
158
- /** the message contents (up to 2000 characters) */
159
- content?: string;
160
- /** embedded rich content (up to 6000 characters) */
161
- embeds?: Embed[];
162
- /** edit the flags of a message (only SUPPRESS_EMBEDS can currently be set/unset) */
163
- flags?: integer;
164
- /** allowed mentions for the message */
165
- allowed_mentions?: AllowedMentions;
166
- /** the components to include with the message */
167
- components?: Component[];
168
- /** the contents of the file being sent/edited */
169
- files?: any;
170
- /** JSON encoded body of non-file params (multipart/form-data only) */
171
- payload_json?: string;
172
- /** attached files to keep and possible descriptions for new files */
173
- attachments?: Attachment[];
174
- }
175
- /** https://discord.com/developers/docs/resources/channel#bulk-delete-messages-json-params */
176
- interface BulkDeleteParams {
177
- /** an array of message ids to delete (2-100) */
178
- messages: snowflake[];
179
- }
180
- }
181
- /** https://discord.com/developers/docs/resources/channel#embed-object-embed-structure */
182
- export interface Embed {
183
- /** title of embed */
184
- title?: string;
185
- /** type of embed (always "rich" for webhook embeds) */
186
- type?: string;
187
- /** description of embed */
188
- description?: string;
189
- /** url of embed */
190
- url?: string;
191
- /** timestamp of embed content */
192
- timestamp?: timestamp;
193
- /** color code of the embed */
194
- color?: integer;
195
- /** footer information */
196
- footer?: Embed.Footer;
197
- /** image information */
198
- image?: Embed.Image;
199
- /** thumbnail information */
200
- thumbnail?: Embed.Thumbnail;
201
- /** video information */
202
- video?: Embed.Video;
203
- /** provider information */
204
- provider?: Embed.Provider;
205
- /** author information */
206
- author?: Embed.Author;
207
- /** fields information */
208
- fields?: Embed.Field[];
209
- }
210
- export declare namespace Embed {
211
- /** https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure */
212
- interface Thumbnail {
213
- /** source url of thumbnail (only supports http(s) and attachments) */
214
- url: string;
215
- /** a proxied url of the thumbnail */
216
- proxy_url?: string;
217
- /** height of thumbnail */
218
- height?: integer;
219
- /** width of thumbnail */
220
- width?: integer;
221
- }
222
- /** https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure */
223
- interface Video {
224
- /** source url of video */
225
- url?: string;
226
- /** a proxied url of the video */
227
- proxy_url?: string;
228
- /** height of video */
229
- height?: integer;
230
- /** width of video */
231
- width?: integer;
232
- }
233
- /** https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure */
234
- interface Image {
235
- /** source url of image (only supports http(s) and attachments) */
236
- url: string;
237
- /** a proxied url of the image */
238
- proxy_url?: string;
239
- /** height of image */
240
- height?: integer;
241
- /** width of image */
242
- width?: integer;
243
- }
244
- /** https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure */
245
- interface Provider {
246
- /** name of provider */
247
- name?: string;
248
- /** url of provider */
249
- url?: string;
250
- }
251
- /** https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure */
252
- interface Author {
253
- /** name of author */
254
- name: string;
255
- /** url of author */
256
- url?: string;
257
- /** url of author icon (only supports http(s) and attachments) */
258
- icon_url?: string;
259
- /** a proxied url of author icon */
260
- proxy_icon_url?: string;
261
- }
262
- /** https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure */
263
- interface Footer {
264
- /** footer text */
265
- text: string;
266
- /** url of footer icon (only supports http(s) and attachments) */
267
- icon_url?: string;
268
- /** a proxied url of footer icon */
269
- proxy_icon_url?: string;
270
- }
271
- /** https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure */
272
- interface Field {
273
- /** name of the field */
274
- name: string;
275
- /** value of the field */
276
- value: string;
277
- /** whether or not this field should display inline */
278
- inline?: boolean;
279
- }
280
- }
281
- /** https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure */
282
- export interface Attachment {
283
- /** attachment id */
284
- id: snowflake;
285
- /** name of file attached */
286
- filename: string;
287
- /** the attachment's media type */
288
- content_type?: string;
289
- /** size of file in bytes */
290
- size: integer;
291
- /** source url of file */
292
- url: string;
293
- /** a proxied url of file */
294
- proxy_url: string;
295
- /** height of file (if image) */
296
- height?: integer;
297
- /** width of file (if image) */
298
- width?: integer;
299
- /** whether this attachment is ephemeral */
300
- ephemeral?: boolean;
301
- }
302
- /** https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure */
303
- export interface ChannelMention {
304
- /** id of the channel */
305
- id: snowflake;
306
- /** id of the guild containing the channel */
307
- guild_id: snowflake;
308
- /** the type of channel */
309
- type: Channel.Type;
310
- /** the name of the channel */
311
- name: string;
312
- }
313
- export declare namespace Message {
314
- namespace Event {
315
- interface Create extends Message {
316
- }
317
- interface Update extends Message {
318
- }
319
- /** https://discord.com/developers/docs/topics/gateway#message-delete-message-delete-event-fields */
320
- interface Delete {
321
- /** the id of the message */
322
- id: snowflake;
323
- /** the id of the channel */
324
- channel_id: snowflake;
325
- /** the id of the guild */
326
- guild_id?: snowflake;
327
- }
328
- /** https://discord.com/developers/docs/topics/gateway#message-delete-bulk-message-delete-bulk-event-fields */
329
- interface DeleteBulk {
330
- /** the ids of the messages */
331
- ids: snowflake[];
332
- /** the id of the channel */
333
- channel_id: snowflake;
334
- /** the id of the guild */
335
- guild_id?: snowflake;
336
- }
337
- }
338
- }
339
- declare module './gateway' {
340
- interface GatewayEvents {
341
- /** message was created */
342
- MESSAGE_CREATE: Message.Event.Create;
343
- /** message was edited */
344
- MESSAGE_UPDATE: Message.Event.Update;
345
- /** message was deleted */
346
- MESSAGE_DELETE: Message.Event.Delete;
347
- /** multiple messages were deleted at once */
348
- MESSAGE_DELETE_BULK: Message.Event.DeleteBulk;
349
- }
350
- }
351
- declare module './internal' {
352
- interface Internal {
353
- /**
354
- * Returns the messages for a channel. If operating on a guild channel, this endpoint requires the VIEW_CHANNEL permission to be present on the current user. If the current user is missing the 'READ_MESSAGE_HISTORY' permission in the channel then this will return no messages (since they cannot read the message history). Returns an array of message objects on success.
355
- * @see https://discord.com/developers/docs/resources/channel#get-channel-messages
356
- */
357
- getChannelMessages(channel_id: snowflake, params?: Message.GetParams): Promise<Message[]>;
358
- /**
359
- * Returns a specific message in the channel. If operating on a guild channel, this endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Returns a message object on success.
360
- * @see https://discord.com/developers/docs/resources/channel#get-channel-message
361
- */
362
- getChannelMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>;
363
- /**
364
- * Post a message to a guild text or DM channel. Returns a message object. Fires a Message Create Gateway event. See message formatting for more information on how to properly format messages.
365
- * @see https://discord.com/developers/docs/resources/channel#create-message
366
- */
367
- createMessage(channel_id: snowflake, params: Message.CreateParams): Promise<Message>;
368
- /**
369
- * Crosspost a message in a News Channel to following channels. This endpoint requires the 'SEND_MESSAGES' permission, if the current user sent the message, or additionally the 'MANAGE_MESSAGES' permission, for all other messages, to be present for the current user.
370
- * @see https://discord.com/developers/docs/resources/channel#crosspost-message
371
- */
372
- crosspostMessage(channel_id: snowflake, message_id: snowflake): Promise<Message>;
373
- /**
374
- * Edit a previously sent message. The fields content, embeds, and flags can be edited by the original message author. Other users can only edit flags and only if they have the MANAGE_MESSAGES permission in the corresponding channel. When specifying flags, ensure to include all previously set flags/bits in addition to ones that you are modifying. Only flags documented in the table below may be modified by users (unsupported flag changes are currently ignored without error).
375
- * @see https://discord.com/developers/docs/resources/channel#edit-message
376
- */
377
- editMessage(channel_id: snowflake, message_id: snowflake, params: Message.EditParams): Promise<Message>;
378
- /**
379
- * Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the current user, this endpoint requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success. Fires a Message Delete Gateway event.
380
- * @see https://discord.com/developers/docs/resources/channel#delete-message
381
- */
382
- deleteMessage(channel_id: snowflake, message_id: snowflake): Promise<void>;
383
- /**
384
- * Delete multiple messages in a single request. This endpoint can only be used on guild channels and requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success. Fires a Message Delete Bulk Gateway event.
385
- * @see https://discord.com/developers/docs/resources/channel#bulk-delete-messages
386
- */
387
- bulkDeleteMessages(channel_id: snowflake, params: Message.BulkDeleteParams): Promise<void>;
388
- /**
389
- * Returns all pinned messages in the channel as an array of message objects.
390
- * @see https://discord.com/developers/docs/resources/channel#get-pinned-messages
391
- */
392
- getPinnedMessages(channel_id: snowflake): Promise<Message[]>;
393
- /**
394
- * Pin a message in a channel. Requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success.
395
- * @see https://discord.com/developers/docs/resources/channel#pin-message
396
- */
397
- pinMessage(channel_id: snowflake, message_id: snowflake): Promise<void>;
398
- /**
399
- * Unpin a message in a channel. Requires the MANAGE_MESSAGES permission. Returns a 204 empty response on success.
400
- * @see https://discord.com/developers/docs/resources/channel#unpin-message
401
- */
402
- unpinMessage(channel_id: snowflake, message_id: snowflake): Promise<void>;
403
- }
404
- }
@@ -1,151 +0,0 @@
1
- import { Emoji, integer, snowflake, User } from '.';
2
- /** https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields */
3
- export interface PresenceUpdateEvent {
4
- /** the user presence is being updated for */
5
- user: User;
6
- /** id of the guild */
7
- guild_id: snowflake;
8
- /** either "idle", "dnd", "online", or "offline" */
9
- status: StatusType;
10
- /** user's current activities */
11
- activities: Activity[];
12
- /** user's platform-dependent status */
13
- client_status: ClientStatus;
14
- }
15
- /** https://discord.com/developers/docs/topics/gateway#update-presence-status-types */
16
- export declare enum StatusType {
17
- /** Online */
18
- ONLINE = "ONLINE",
19
- /** Do Not Disturb */
20
- DND = "DND",
21
- /** AFK */
22
- IDLE = "IDLE",
23
- /** Invisible and shown as offline */
24
- INVISIBLE = "INVISIBLE",
25
- /** Offline */
26
- OFFLINE = "OFFLINE"
27
- }
28
- /** https://discord.com/developers/docs/topics/gateway#client-status-object */
29
- export interface ClientStatus {
30
- /** the user's status set for an active desktop (Windows, Linux, Mac) application session */
31
- desktop?: string;
32
- /** the user's status set for an active mobile (iOS, Android) application session */
33
- mobile?: string;
34
- /** the user's status set for an active web (browser, bot account) application session */
35
- web?: string;
36
- }
37
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure */
38
- export interface Activity {
39
- /** the activity's name */
40
- name: string;
41
- /** activity type */
42
- type: integer;
43
- /** stream url, is validated when type is 1 */
44
- url?: string;
45
- /** unix timestamp (in milliseconds) of when the activity was added to the user's session */
46
- created_at: integer;
47
- /** unix timestamps for start and/or end of the game */
48
- timestamps?: ActivityTimestamps;
49
- /** application id for the game */
50
- application_id?: snowflake;
51
- /** what the player is currently doing */
52
- details?: string;
53
- /** the user's current party status */
54
- state?: string;
55
- /** the emoji used for a custom status */
56
- emoji?: Emoji;
57
- /** information for the current party of the player */
58
- party?: ActivityParty;
59
- /** images for the presence and their hover texts */
60
- assets?: ActivityAssets;
61
- /** secrets for Rich Presence joining and spectating */
62
- secrets?: ActivitySecrets;
63
- /** whether or not the activity is an instanced game session */
64
- instance?: boolean;
65
- /** activity flags ORd together, describes what the payload includes */
66
- flags?: integer;
67
- /** the custom buttons shown in the Rich Presence (max 2) */
68
- buttons?: ActivityButton[];
69
- }
70
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps */
71
- export interface ActivityTimestamps {
72
- /** unix time (in milliseconds) of when the activity started */
73
- start?: integer;
74
- /** unix time (in milliseconds) of when the activity ends */
75
- end?: integer;
76
- }
77
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji */
78
- export interface ActivityEmoji {
79
- /** the name of the emoji */
80
- name: string;
81
- /** the id of the emoji */
82
- id?: snowflake;
83
- /** whether this emoji is animated */
84
- animated?: boolean;
85
- }
86
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-party */
87
- export interface ActivityParty {
88
- /** the id of the party */
89
- id?: string;
90
- /** used to show the party's current and maximum size */
91
- size?: [current_size: integer, max_size: integer];
92
- }
93
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets */
94
- export interface ActivityAssets {
95
- /** the id for a large asset of the activity, usually a snowflake */
96
- large_image?: string;
97
- /** text displayed when hovering over the large image of the activity */
98
- large_text?: string;
99
- /** the id for a small asset of the activity, usually a snowflake */
100
- small_image?: string;
101
- /** text displayed when hovering over the small image of the activity */
102
- small_text?: string;
103
- }
104
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets */
105
- export interface ActivitySecrets {
106
- /** the id for a large asset of the activity, usually a snowflake */
107
- large_image?: string;
108
- /** text displayed when hovering over the large image of the activity */
109
- large_text?: string;
110
- /** the id for a small asset of the activity, usually a snowflake */
111
- small_image?: string;
112
- /** text displayed when hovering over the small image of the activity */
113
- small_text?: string;
114
- }
115
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-button */
116
- export interface ActivityButton {
117
- /** the text shown on the button (1-32 characters) */
118
- label: string;
119
- /** the url opened when clicking the button (1-512 characters) */
120
- url: string;
121
- }
122
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-types */
123
- export declare enum ActivityType {
124
- /** Playing {name} */
125
- GAME = 0,
126
- /** Streaming {details} */
127
- STREAMING = 1,
128
- /** Listening to {name} */
129
- LISTENING = 2,
130
- /** Watching {name} */
131
- WATCHING = 3,
132
- /** {emoji} {name} */
133
- CUSTOM = 4,
134
- /** Competing in {name} */
135
- COMPETING = 5
136
- }
137
- /** https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags */
138
- export declare enum ActivityFlag {
139
- INSTANCE = 1,
140
- JOIN = 2,
141
- SPECTATE = 4,
142
- JOIN_REQUEST = 8,
143
- SYNC = 16,
144
- PLAY = 32
145
- }
146
- declare module './gateway' {
147
- interface GatewayEvents {
148
- /** user was updated */
149
- PRESENCE_UPDATE: PresenceUpdateEvent;
150
- }
151
- }
@@ -1,114 +0,0 @@
1
- import { Emoji, GuildMember, integer, snowflake } from '.';
2
- /** https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure */
3
- export interface Reaction {
4
- /** times this emoji has been used to react */
5
- count: integer;
6
- /** whether the current user reacted using this emoji */
7
- me: boolean;
8
- /** emoji information */
9
- emoji: Partial<Emoji>;
10
- }
11
- export declare namespace Reaction {
12
- namespace Event {
13
- /** https://discord.com/developers/docs/topics/gateway#message-reaction-add-message-reaction-add-event-fields */
14
- interface Add {
15
- /** the id of the user */
16
- user_id: snowflake;
17
- /** the id of the channel */
18
- channel_id: snowflake;
19
- /** the id of the message */
20
- message_id: snowflake;
21
- /** the id of the guild */
22
- guild_id?: snowflake;
23
- /** the member who reacted if this happened in a guild */
24
- member?: GuildMember;
25
- /** the emoji used to react - example */
26
- emoji: Partial<Emoji>;
27
- }
28
- /** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-message-reaction-remove-event-fields */
29
- interface Remove {
30
- /** the id of the user */
31
- user_id: snowflake;
32
- /** the id of the channel */
33
- channel_id: snowflake;
34
- /** the id of the message */
35
- message_id: snowflake;
36
- /** the id of the guild */
37
- guild_id?: snowflake;
38
- /** the emoji used to react - example */
39
- emoji: Partial<Emoji>;
40
- }
41
- /** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all-message-reaction-remove-all-event-fields */
42
- interface RemoveAll {
43
- /** the id of the channel */
44
- channel_id: snowflake;
45
- /** the id of the message */
46
- message_id: snowflake;
47
- /** the id of the guild */
48
- guild_id?: snowflake;
49
- }
50
- /** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji-message-reaction-remove-emoji */
51
- interface RemoveEmoji {
52
- /** the id of the channel */
53
- channel_id: snowflake;
54
- /** the id of the guild */
55
- guild_id?: snowflake;
56
- /** the id of the message */
57
- message_id: snowflake;
58
- /** the emoji that was removed */
59
- emoji: Partial<Emoji>;
60
- }
61
- }
62
- interface GetParams {
63
- /** get users after this user ID */
64
- after?: snowflake;
65
- /** max number of users to return (1-100) */
66
- limit?: integer;
67
- }
68
- }
69
- declare module './gateway' {
70
- interface GatewayEvents {
71
- /** user reacted to a message */
72
- MESSAGE_REACTION_ADD: Reaction.Event.Add;
73
- /** user removed a reaction from a message */
74
- MESSAGE_REACTION_REMOVE: Reaction.Event.Remove;
75
- /** all reactions were explicitly removed from a message */
76
- MESSAGE_REACTION_REMOVE_ALL: Reaction.Event.RemoveAll;
77
- /** all reactions for a given emoji were explicitly removed from a message */
78
- MESSAGE_REACTION_REMOVE_EMOJI: Reaction.Event.RemoveEmoji;
79
- }
80
- }
81
- declare module './internal' {
82
- interface Internal {
83
- /**
84
- * Create a reaction for the message. This endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Additionally, if nobody else has reacted to the message using this emoji, this endpoint requires the 'ADD_REACTIONS' permission to be present on the current user. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.
85
- * @see https://discord.com/developers/docs/resources/channel#create-reaction
86
- */
87
- createReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>;
88
- /**
89
- * Delete a reaction the current user has made for the message. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.
90
- * @see https://discord.com/developers/docs/resources/channel#delete-own-reaction
91
- */
92
- deleteOwnReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>;
93
- /**
94
- * Deletes another user's reaction. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user. Returns a 204 empty response on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.
95
- * @see https://discord.com/developers/docs/resources/channel#delete-user-reaction
96
- */
97
- deleteUserReaction(channel_id: snowflake, message_id: snowflake, emoji: string, user_id: snowflake): Promise<void>;
98
- /**
99
- * Get a list of users that reacted with this emoji. Returns an array of user objects on success. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.
100
- * @see https://discord.com/developers/docs/resources/channel#get-reactions
101
- */
102
- getReactions(channel_id: snowflake, message_id: snowflake, emoji: string, params?: Reaction.GetParams): Promise<Reaction[]>;
103
- /**
104
- * Deletes all reactions on a message. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user. Fires a Message Reaction Remove All Gateway event.
105
- * @see https://discord.com/developers/docs/resources/channel#delete-all-reactions
106
- */
107
- deleteAllReactions(channel_id: snowflake, message_id: snowflake): Promise<void>;
108
- /**
109
- * Deletes all the reactions for a given emoji on a message. This endpoint requires the MANAGE_MESSAGES permission to be present on the current user. Fires a Message Reaction Remove Emoji Gateway event. The emoji must be URL Encoded or the request will fail with 10014: Unknown Emoji. To use custom emoji, you must encode it in the format name:id with the emoji name and emoji id.
110
- * @see https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji
111
- */
112
- deleteAllReactionsForEmoji(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>;
113
- }
114
- }