@koishijs/plugin-adapter-discord 2.0.0-rc.1 → 2.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.
- package/lib/bot.d.ts +13 -6
- package/lib/index.d.ts +0 -3
- package/lib/index.js +589 -464
- package/lib/index.js.map +3 -3
- package/lib/sender.d.ts +9 -7
- package/lib/types/application.d.ts +8 -2
- package/lib/types/audit-log.d.ts +111 -95
- package/lib/types/ban.d.ts +67 -0
- package/lib/types/channel.d.ts +223 -102
- package/lib/types/command.d.ts +182 -112
- package/lib/types/emoji.d.ts +26 -107
- package/lib/types/gateway.d.ts +8 -2
- package/lib/types/guild-member.d.ts +178 -72
- package/lib/types/guild-scheduled-event.d.ts +167 -0
- package/lib/types/guild-template.d.ts +62 -0
- package/lib/types/guild.d.ts +195 -43
- package/lib/types/index.d.ts +4 -0
- package/lib/types/integration.d.ts +14 -0
- package/lib/types/interaction.d.ts +59 -2
- package/lib/types/internal.d.ts +3 -3
- package/lib/types/invite.d.ts +127 -77
- package/lib/types/message.d.ts +274 -188
- package/lib/types/reaction.d.ts +114 -0
- package/lib/types/role.d.ts +74 -0
- package/lib/types/scheduled-event.d.ts +167 -0
- package/lib/types/stage-instance.d.ts +54 -8
- package/lib/types/sticker.d.ts +117 -48
- package/lib/types/thread.d.ts +201 -0
- package/lib/types/user.d.ts +28 -11
- package/lib/types/voice.d.ts +35 -1
- package/lib/types/webhook.d.ts +150 -37
- package/lib/utils.d.ts +3 -2
- package/lib/ws.d.ts +3 -6
- package/package.json +9 -7
package/lib/types/command.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Channel, snowflake } from '.';
|
|
2
2
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
|
|
3
3
|
export interface ApplicationCommand {
|
|
4
4
|
/** unique id of the command */
|
|
5
5
|
id: snowflake;
|
|
6
6
|
/** the type of command, defaults 1 if not set */
|
|
7
|
-
type?:
|
|
7
|
+
type?: ApplicationCommand.Type;
|
|
8
8
|
/** unique id of the parent application */
|
|
9
9
|
application_id: snowflake;
|
|
10
10
|
/** guild id of the command, if not global */
|
|
@@ -14,131 +14,201 @@ export interface ApplicationCommand {
|
|
|
14
14
|
/** 1-100 character description for CHAT_INPUT commands, empty string for USER and MESSAGE commands */
|
|
15
15
|
description: string;
|
|
16
16
|
/** the parameters for the command, max 25 */
|
|
17
|
-
options?:
|
|
17
|
+
options?: ApplicationCommand.Option[];
|
|
18
18
|
/** whether the command is enabled by default when the app is added to a guild */
|
|
19
19
|
default_permission?: boolean;
|
|
20
20
|
/** autoincrementing version identifier updated during substantial record changes */
|
|
21
21
|
version: snowflake;
|
|
22
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
|
-
|
|
23
|
+
export declare namespace ApplicationCommand {
|
|
24
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types */
|
|
25
|
+
enum Type {
|
|
26
|
+
/** Slash commands; a text-based command that shows up when a user types / */
|
|
27
|
+
CHAT_INPUT = 1,
|
|
28
|
+
/** A UI-based command that shows up when you right click or tap on a user */
|
|
29
|
+
USER = 2,
|
|
30
|
+
/** A UI-based command that shows up when you right click or tap on a message */
|
|
31
|
+
MESSAGE = 3
|
|
32
|
+
}
|
|
33
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure */
|
|
34
|
+
interface Option {
|
|
35
|
+
/** the type of option */
|
|
36
|
+
type: OptionType;
|
|
37
|
+
/** 1-32 character name */
|
|
38
|
+
name: string;
|
|
39
|
+
/** 1-100 character description */
|
|
40
|
+
description: string;
|
|
41
|
+
/** if the parameter is required or optional--default false */
|
|
42
|
+
required?: boolean;
|
|
43
|
+
/** choices for STRING, INTEGER, and NUMBER types for the user to pick from, max 25 */
|
|
44
|
+
choices?: OptionChoice[];
|
|
45
|
+
/** if the option is a subcommand or subcommand group type, this nested options will be the parameters */
|
|
46
|
+
options?: Option[];
|
|
47
|
+
/** if the option is a channel type, the channels shown will be restricted to these types */
|
|
48
|
+
channel_types?: Channel.Type[];
|
|
49
|
+
}
|
|
50
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type */
|
|
51
|
+
enum OptionType {
|
|
52
|
+
SUB_COMMAND = 1,
|
|
53
|
+
SUB_COMMAND_GROUP = 2,
|
|
54
|
+
STRING = 3,
|
|
55
|
+
/** Any integer between -2^53 and 2^53 */
|
|
56
|
+
INTEGER = 4,
|
|
57
|
+
BOOLEAN = 5,
|
|
58
|
+
USER = 6,
|
|
59
|
+
/** Includes all channel types + categories */
|
|
60
|
+
CHANNEL = 7,
|
|
61
|
+
ROLE = 8,
|
|
62
|
+
/** Includes users and roles */
|
|
63
|
+
MENTIONABLE = 9,
|
|
64
|
+
/** Any double between -2^53 and 2^53 */
|
|
65
|
+
NUMBER = 10
|
|
66
|
+
}
|
|
67
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
|
|
68
|
+
interface OptionChoice {
|
|
69
|
+
/** 1-100 character choice name */
|
|
70
|
+
name: string;
|
|
71
|
+
/** value of the choice, up to 100 characters if string */
|
|
72
|
+
value: string | number;
|
|
73
|
+
}
|
|
74
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */
|
|
75
|
+
interface GuildPermissions {
|
|
76
|
+
/** the id of the command */
|
|
77
|
+
id: snowflake;
|
|
78
|
+
/** the id of the application the command belongs to */
|
|
79
|
+
application_id: snowflake;
|
|
80
|
+
/** the id of the guild */
|
|
81
|
+
guild_id: snowflake;
|
|
82
|
+
/** the permissions for the command in the guild */
|
|
83
|
+
permissions: Permissions[];
|
|
84
|
+
}
|
|
85
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */
|
|
86
|
+
interface Permissions {
|
|
87
|
+
/** the id of the role or user */
|
|
88
|
+
id: snowflake;
|
|
89
|
+
/** role or user */
|
|
90
|
+
type: PermissionType;
|
|
91
|
+
/** true to allow, false, to disallow */
|
|
92
|
+
permission: boolean;
|
|
93
|
+
}
|
|
94
|
+
/** https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type */
|
|
95
|
+
enum PermissionType {
|
|
96
|
+
ROLE = 1,
|
|
97
|
+
USER = 2
|
|
98
|
+
}
|
|
99
|
+
namespace Params {
|
|
100
|
+
/** https://discord.com/developers/docs/interactions/application-commands#create-global-application-command-json-params */
|
|
101
|
+
interface Create {
|
|
102
|
+
/** 1-32 character name */
|
|
103
|
+
name: string;
|
|
104
|
+
/** 1-100 character description */
|
|
105
|
+
description: string;
|
|
106
|
+
/** the parameters for the command */
|
|
107
|
+
options?: Option[];
|
|
108
|
+
/** whether the command is enabled by default when the app is added to a guild */
|
|
109
|
+
default_permission?: boolean;
|
|
110
|
+
/** the type of command, defaults 1 if not set */
|
|
111
|
+
type?: Type;
|
|
112
|
+
}
|
|
113
|
+
/** https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command-json-params */
|
|
114
|
+
interface Edit {
|
|
115
|
+
/** 1-32 character name */
|
|
116
|
+
name?: string;
|
|
117
|
+
/** 1-100 character description */
|
|
118
|
+
description?: string;
|
|
119
|
+
/** the parameters for the command */
|
|
120
|
+
options?: Option[];
|
|
121
|
+
/** whether the command is enabled by default when the app is added to a guild */
|
|
122
|
+
default_permission?: boolean;
|
|
123
|
+
}
|
|
124
|
+
/** https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions-json-params */
|
|
125
|
+
interface EditPermissions {
|
|
126
|
+
/** the permissions for the command in the guild */
|
|
127
|
+
permissions: Permissions[];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
108
130
|
}
|
|
109
131
|
declare module './internal' {
|
|
110
132
|
interface Internal {
|
|
111
|
-
/**
|
|
133
|
+
/**
|
|
134
|
+
* Fetch all of the global commands for your application. Returns an array of application command objects.
|
|
135
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
|
|
136
|
+
*/
|
|
112
137
|
getGlobalApplicationCommands(application_id: snowflake): Promise<ApplicationCommand[]>;
|
|
113
|
-
/**
|
|
114
|
-
|
|
115
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
140
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
|
141
|
+
*/
|
|
142
|
+
createGlobalApplicationCommand(application_id: snowflake, param: ApplicationCommand.Params.Create): Promise<ApplicationCommand>;
|
|
143
|
+
/**
|
|
144
|
+
* Takes a list of application commands, overwriting the existing global command list for this application. Updates will be available in all guilds after 1 hour. Returns 200 and a list of application command objects. Commands that do not already exist will count toward daily application command create limits.
|
|
145
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands
|
|
146
|
+
*/
|
|
116
147
|
bulkOverwriteGlobalApplicationCommands(application_id: snowflake): Promise<ApplicationCommand[]>;
|
|
117
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* Fetch a global command for your application. Returns an application command object.
|
|
150
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#get-global-application-command
|
|
151
|
+
*/
|
|
118
152
|
getGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>;
|
|
119
|
-
/**
|
|
120
|
-
|
|
121
|
-
|
|
153
|
+
/**
|
|
154
|
+
* All parameters for this endpoint are optional.
|
|
155
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command
|
|
156
|
+
*/
|
|
157
|
+
editGlobalApplicationCommand(application_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.Edit): Promise<ApplicationCommand>;
|
|
158
|
+
/**
|
|
159
|
+
* Deletes a global command. Returns 204 No Content on success.
|
|
160
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command
|
|
161
|
+
*/
|
|
122
162
|
deleteGlobalApplicationCommand(application_id: snowflake, command_id: snowflake): Promise<void>;
|
|
123
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* Fetch all of the guild commands for your application for a specific guild. Returns an array of application command objects.
|
|
165
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
|
|
166
|
+
*/
|
|
124
167
|
getGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand[]>;
|
|
125
|
-
/**
|
|
126
|
-
|
|
127
|
-
|
|
168
|
+
/**
|
|
169
|
+
* Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
170
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
|
|
171
|
+
*/
|
|
172
|
+
createGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, param: ApplicationCommand.Params.Create): Promise<ApplicationCommand>;
|
|
173
|
+
/**
|
|
174
|
+
* Takes a list of application commands, overwriting the existing command list for this application for the targeted guild. Returns 200 and a list of application command objects.
|
|
175
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
|
|
176
|
+
*/
|
|
128
177
|
bulkOverwriteGuildApplicationCommands(application_id: snowflake, guild_id: snowflake): Promise<void>;
|
|
129
|
-
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Fetches command permissions for all commands for your application in a guild. Returns an array of guild application command permissions objects.
|
|
180
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions
|
|
181
|
+
*/
|
|
182
|
+
getGuildApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake): Promise<ApplicationCommand.GuildPermissions[]>;
|
|
183
|
+
/**
|
|
184
|
+
* This endpoint will overwrite all existing permissions for all commands in a guild, including slash commands, user commands, and message commands.
|
|
185
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#batch-edit-application-command-permissions
|
|
186
|
+
*/
|
|
187
|
+
batchEditApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, permissions: Partial<ApplicationCommand.GuildPermissions>[]): Promise<void>;
|
|
188
|
+
/**
|
|
189
|
+
* Fetch a guild command for your application. Returns an application command object.
|
|
190
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command
|
|
191
|
+
*/
|
|
134
192
|
getGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand>;
|
|
135
|
-
/**
|
|
136
|
-
|
|
137
|
-
|
|
193
|
+
/**
|
|
194
|
+
* All parameters for this endpoint are optional.
|
|
195
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
|
|
196
|
+
*/
|
|
197
|
+
editGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.Edit): Promise<ApplicationCommand>;
|
|
198
|
+
/**
|
|
199
|
+
* Delete a guild command. Returns 204 No Content on success.
|
|
200
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command
|
|
201
|
+
*/
|
|
138
202
|
deleteGuildApplicationCommand(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<void>;
|
|
139
|
-
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
203
|
+
/**
|
|
204
|
+
* Fetches command permissions for a specific command for your application in a guild. Returns a guild application command permissions object.
|
|
205
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions
|
|
206
|
+
*/
|
|
207
|
+
getApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake): Promise<ApplicationCommand.GuildPermissions>;
|
|
208
|
+
/**
|
|
209
|
+
* This endpoint will overwrite existing permissions for the command in that guild
|
|
210
|
+
* @see https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions
|
|
211
|
+
*/
|
|
212
|
+
editApplicationCommandPermissions(application_id: snowflake, guild_id: snowflake, command_id: snowflake, param: ApplicationCommand.Params.EditPermissions): Promise<ApplicationCommand.GuildPermissions>;
|
|
143
213
|
}
|
|
144
214
|
}
|
package/lib/types/emoji.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { snowflake, User } from '.';
|
|
2
2
|
/** https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure */
|
|
3
3
|
export interface Emoji {
|
|
4
4
|
/** emoji id */
|
|
@@ -18,94 +18,35 @@ export interface Emoji {
|
|
|
18
18
|
/** whether this emoji can be used, may be false due to loss of Server Boosts */
|
|
19
19
|
available?: boolean;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
/** the id of the message */
|
|
44
|
-
message_id: snowflake;
|
|
45
|
-
/** the id of the guild */
|
|
46
|
-
guild_id?: snowflake;
|
|
47
|
-
/** the member who reacted if this happened in a guild */
|
|
48
|
-
member?: GuildMember;
|
|
49
|
-
/** the emoji used to react - example */
|
|
50
|
-
emoji: Partial<Emoji>;
|
|
51
|
-
}
|
|
52
|
-
/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-message-reaction-remove-event-fields */
|
|
53
|
-
export interface MessageReactionRemoveEvent {
|
|
54
|
-
/** the id of the user */
|
|
55
|
-
user_id: snowflake;
|
|
56
|
-
/** the id of the channel */
|
|
57
|
-
channel_id: snowflake;
|
|
58
|
-
/** the id of the message */
|
|
59
|
-
message_id: snowflake;
|
|
60
|
-
/** the id of the guild */
|
|
61
|
-
guild_id?: snowflake;
|
|
62
|
-
/** the emoji used to react - example */
|
|
63
|
-
emoji: Partial<Emoji>;
|
|
64
|
-
}
|
|
65
|
-
/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all-message-reaction-remove-all-event-fields */
|
|
66
|
-
export interface MessageReactionRemoveAllEvent {
|
|
67
|
-
/** the id of the channel */
|
|
68
|
-
channel_id: snowflake;
|
|
69
|
-
/** the id of the message */
|
|
70
|
-
message_id: snowflake;
|
|
71
|
-
/** the id of the guild */
|
|
72
|
-
guild_id?: snowflake;
|
|
73
|
-
}
|
|
74
|
-
/** https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji-message-reaction-remove-emoji */
|
|
75
|
-
export interface MessageReactionRemoveEmojiEvent {
|
|
76
|
-
/** the id of the channel */
|
|
77
|
-
channel_id: snowflake;
|
|
78
|
-
/** the id of the guild */
|
|
79
|
-
guild_id?: snowflake;
|
|
80
|
-
/** the id of the message */
|
|
81
|
-
message_id: snowflake;
|
|
82
|
-
/** the emoji that was removed */
|
|
83
|
-
emoji: Partial<Emoji>;
|
|
21
|
+
export declare namespace Emoji {
|
|
22
|
+
namespace Event {
|
|
23
|
+
/** https://discord.com/developers/docs/topics/gateway#guild-emojis-update-guild-emojis-update-event-fields */
|
|
24
|
+
interface Update {
|
|
25
|
+
/** id of the guild */
|
|
26
|
+
guild_id: snowflake;
|
|
27
|
+
/** array of emojis */
|
|
28
|
+
emojis: Emoji[];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params */
|
|
32
|
+
interface CreateParams extends ModifyParams {
|
|
33
|
+
/** the 128x128 emoji image */
|
|
34
|
+
image: string;
|
|
35
|
+
}
|
|
36
|
+
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji-json-params */
|
|
37
|
+
interface ModifyParams {
|
|
38
|
+
/** name of the emoji */
|
|
39
|
+
name?: string;
|
|
40
|
+
/** array of snowflakes roles allowed to use this emoji */
|
|
41
|
+
roles?: snowflake[];
|
|
42
|
+
}
|
|
84
43
|
}
|
|
85
44
|
declare module './gateway' {
|
|
86
45
|
interface GatewayEvents {
|
|
87
46
|
/** guild emojis were updated */
|
|
88
|
-
GUILD_EMOJIS_UPDATE:
|
|
89
|
-
/** user reacted to a message */
|
|
90
|
-
MESSAGE_REACTION_ADD: MessageReactionAddEvent;
|
|
91
|
-
/** user removed a reaction from a message */
|
|
92
|
-
MESSAGE_REACTION_REMOVE: MessageReactionRemoveEvent;
|
|
93
|
-
/** all reactions were explicitly removed from a message */
|
|
94
|
-
MESSAGE_REACTION_REMOVE_ALL: MessageReactionRemoveAllEvent;
|
|
95
|
-
/** all reactions for a given emoji were explicitly removed from a message */
|
|
96
|
-
MESSAGE_REACTION_REMOVE_EMOJI: MessageReactionRemoveEmojiEvent;
|
|
47
|
+
GUILD_EMOJIS_UPDATE: Emoji.Event.Update;
|
|
97
48
|
}
|
|
98
49
|
}
|
|
99
|
-
export interface ModifyGuildEmojiOptions {
|
|
100
|
-
/** name of the emoji */
|
|
101
|
-
name?: string;
|
|
102
|
-
/** array of snowflakes roles allowed to use this emoji */
|
|
103
|
-
roles?: snowflake[];
|
|
104
|
-
}
|
|
105
|
-
export interface CreateGuildEmojiOptions extends ModifyGuildEmojiOptions {
|
|
106
|
-
/** the 128x128 emoji image */
|
|
107
|
-
image: string;
|
|
108
|
-
}
|
|
109
50
|
declare module './internal' {
|
|
110
51
|
interface Internal {
|
|
111
52
|
/** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
|
|
@@ -113,32 +54,10 @@ declare module './internal' {
|
|
|
113
54
|
/** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
|
|
114
55
|
getGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<Emoji>;
|
|
115
56
|
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
|
|
116
|
-
createGuildEmoji(guild_id: snowflake, options:
|
|
57
|
+
createGuildEmoji(guild_id: snowflake, options: Emoji.CreateParams): Promise<Emoji>;
|
|
117
58
|
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
|
|
118
|
-
modifyGuildEmoji(guild_id: snowflake, emoji_id: snowflake, options:
|
|
59
|
+
modifyGuildEmoji(guild_id: snowflake, emoji_id: snowflake, options: Emoji.ModifyParams): Promise<Emoji>;
|
|
119
60
|
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
|
120
61
|
deleteGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<void>;
|
|
121
62
|
}
|
|
122
63
|
}
|
|
123
|
-
export interface GetReactionsOptions {
|
|
124
|
-
/** get users after this user ID */
|
|
125
|
-
after?: snowflake;
|
|
126
|
-
/** max number of users to return (1-100) */
|
|
127
|
-
limit?: integer;
|
|
128
|
-
}
|
|
129
|
-
declare module './internal' {
|
|
130
|
-
interface Internal {
|
|
131
|
-
/** https://discord.com/developers/docs/resources/channel#create-reaction */
|
|
132
|
-
createReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>;
|
|
133
|
-
/** https://discord.com/developers/docs/resources/channel#delete-own-reaction */
|
|
134
|
-
deleteOwnReaction(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>;
|
|
135
|
-
/** https://discord.com/developers/docs/resources/channel#delete-user-reaction */
|
|
136
|
-
deleteUserReaction(channel_id: snowflake, message_id: snowflake, emoji: string, user_id: snowflake): Promise<void>;
|
|
137
|
-
/** https://discord.com/developers/docs/resources/channel#get-reactions */
|
|
138
|
-
getReactions(channel_id: snowflake, message_id: snowflake, emoji: string, options?: GetReactionsOptions): Promise<Reaction[]>;
|
|
139
|
-
/** https://discord.com/developers/docs/resources/channel#delete-all-reactions */
|
|
140
|
-
deleteAllReactions(channel_id: snowflake, message_id: snowflake): Promise<void>;
|
|
141
|
-
/** https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji */
|
|
142
|
-
deleteAllReactionsForEmoji(channel_id: snowflake, message_id: snowflake, emoji: string): Promise<void>;
|
|
143
|
-
}
|
|
144
|
-
}
|
package/lib/types/gateway.d.ts
CHANGED
|
@@ -234,9 +234,15 @@ export interface SessionStartLimit {
|
|
|
234
234
|
}
|
|
235
235
|
declare module './internal' {
|
|
236
236
|
interface Internal {
|
|
237
|
-
/**
|
|
237
|
+
/**
|
|
238
|
+
* Returns an object with a single valid WSS URL, which the client can use for Connecting. Clients should cache this value and only call this endpoint to retrieve a new URL if they are unable to properly establish a connection using the cached version of the URL.
|
|
239
|
+
* @see https://discord.com/developers/docs/topics/gateway#get-gateway
|
|
240
|
+
*/
|
|
238
241
|
getGateway(): Promise<any>;
|
|
239
|
-
/**
|
|
242
|
+
/**
|
|
243
|
+
* Returns an object based on the information in Get Gateway, plus additional metadata that can help during the operation of large or sharded bots. Unlike the Get Gateway, this route should not be cached for extended periods of time as the value is not guaranteed to be the same per-call, and changes as the bot joins/leaves guilds.
|
|
244
|
+
* @see https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
|
245
|
+
*/
|
|
240
246
|
getGatewayBot(): Promise<any>;
|
|
241
247
|
}
|
|
242
248
|
}
|