@koishijs/plugin-adapter-discord 2.1.2 → 3.1.0
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/index.d.ts +3 -14
- package/lib/index.js +21 -1544
- package/lib/index.js.map +4 -4
- package/package.json +10 -22
- package/lib/bot.d.ts +0 -64
- package/lib/sender.d.ts +0 -36
- package/lib/types/application.d.ts +0 -84
- package/lib/types/audit-log.d.ts +0 -128
- package/lib/types/ban.d.ts +0 -67
- package/lib/types/channel.d.ts +0 -368
- package/lib/types/command.d.ts +0 -214
- package/lib/types/component.d.ts +0 -84
- package/lib/types/device.d.ts +0 -41
- package/lib/types/emoji.d.ts +0 -63
- package/lib/types/gateway.d.ts +0 -248
- package/lib/types/guild-member.d.ts +0 -216
- package/lib/types/guild-scheduled-event.d.ts +0 -167
- package/lib/types/guild-template.d.ts +0 -88
- package/lib/types/guild.d.ts +0 -419
- package/lib/types/index.d.ts +0 -31
- package/lib/types/integration.d.ts +0 -111
- package/lib/types/interaction.d.ts +0 -182
- package/lib/types/internal.d.ts +0 -8
- package/lib/types/invite.d.ts +0 -163
- package/lib/types/message.d.ts +0 -404
- package/lib/types/presence.d.ts +0 -151
- package/lib/types/reaction.d.ts +0 -114
- package/lib/types/role.d.ts +0 -221
- package/lib/types/scheduled-event.d.ts +0 -167
- package/lib/types/stage-instance.d.ts +0 -78
- package/lib/types/sticker.d.ts +0 -149
- package/lib/types/team.d.ts +0 -30
- package/lib/types/thread.d.ts +0 -201
- package/lib/types/user.d.ts +0 -122
- package/lib/types/voice.d.ts +0 -102
- package/lib/types/webhook.d.ts +0 -199
- package/lib/types.d.ts +0 -354
- package/lib/utils.d.ts +0 -15
- package/lib/ws.d.ts +0 -26
package/lib/types/device.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** https://discord.com/developers/docs/topics/certified-devices#models-device-object */
|
|
2
|
-
export interface Device {
|
|
3
|
-
/** the type of device */
|
|
4
|
-
type: DeviceType;
|
|
5
|
-
/** the device's Windows UUID */
|
|
6
|
-
id: string;
|
|
7
|
-
/** the hardware vendor */
|
|
8
|
-
vendor: Vendor;
|
|
9
|
-
/** the model of the product */
|
|
10
|
-
model: Model;
|
|
11
|
-
/** UUIDs of related devices */
|
|
12
|
-
related: string[];
|
|
13
|
-
/** if the device's native echo cancellation is enabled */
|
|
14
|
-
echo_cancellation?: boolean;
|
|
15
|
-
/** if the device's native noise suppression is enabled */
|
|
16
|
-
noise_suppression?: boolean;
|
|
17
|
-
/** if the device's native automatic gain control is enabled */
|
|
18
|
-
automatic_gain_control?: boolean;
|
|
19
|
-
/** if the device is hardware muted */
|
|
20
|
-
hardware_mute?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/** https://discord.com/developers/docs/topics/certified-devices#models-vendor-object */
|
|
23
|
-
export interface Vendor {
|
|
24
|
-
/** name of the vendor */
|
|
25
|
-
name: string;
|
|
26
|
-
/** url for the vendor */
|
|
27
|
-
url: string;
|
|
28
|
-
}
|
|
29
|
-
/** https://discord.com/developers/docs/topics/certified-devices#models-model-object */
|
|
30
|
-
export interface Model {
|
|
31
|
-
/** name of the model */
|
|
32
|
-
name: string;
|
|
33
|
-
/** url for the model */
|
|
34
|
-
url: string;
|
|
35
|
-
}
|
|
36
|
-
/** https://discord.com/developers/docs/topics/certified-devices#models-device-type */
|
|
37
|
-
export declare enum DeviceType {
|
|
38
|
-
AUDIO_INPUT = "audioinput",
|
|
39
|
-
AUDIO_OUTPUT = "audiooutput",
|
|
40
|
-
VIDEO_INPUT = "videoinput"
|
|
41
|
-
}
|
package/lib/types/emoji.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { snowflake, User } from '.';
|
|
2
|
-
/** https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure */
|
|
3
|
-
export interface Emoji {
|
|
4
|
-
/** emoji id */
|
|
5
|
-
id?: snowflake;
|
|
6
|
-
/** emoji name */
|
|
7
|
-
name?: string;
|
|
8
|
-
/** roles allowed to use this emoji */
|
|
9
|
-
roles?: snowflake[];
|
|
10
|
-
/** user that created this emoji */
|
|
11
|
-
user?: User;
|
|
12
|
-
/** whether this emoji must be wrapped in colons */
|
|
13
|
-
require_colons?: boolean;
|
|
14
|
-
/** whether this emoji is managed */
|
|
15
|
-
managed?: boolean;
|
|
16
|
-
/** whether this emoji is animated */
|
|
17
|
-
animated?: boolean;
|
|
18
|
-
/** whether this emoji can be used, may be false due to loss of Server Boosts */
|
|
19
|
-
available?: boolean;
|
|
20
|
-
}
|
|
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
|
-
}
|
|
43
|
-
}
|
|
44
|
-
declare module './gateway' {
|
|
45
|
-
interface GatewayEvents {
|
|
46
|
-
/** guild emojis were updated */
|
|
47
|
-
GUILD_EMOJIS_UPDATE: Emoji.Event.Update;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
declare module './internal' {
|
|
51
|
-
interface Internal {
|
|
52
|
-
/** https://discord.com/developers/docs/resources/emoji#list-guild-emojis */
|
|
53
|
-
listGuildEmojis(guild_id: snowflake): Promise<Emoji[]>;
|
|
54
|
-
/** https://discord.com/developers/docs/resources/emoji#get-guild-emoji */
|
|
55
|
-
getGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<Emoji>;
|
|
56
|
-
/** https://discord.com/developers/docs/resources/emoji#create-guild-emoji */
|
|
57
|
-
createGuildEmoji(guild_id: snowflake, options: Emoji.CreateParams): Promise<Emoji>;
|
|
58
|
-
/** https://discord.com/developers/docs/resources/emoji#modify-guild-emoji */
|
|
59
|
-
modifyGuildEmoji(guild_id: snowflake, emoji_id: snowflake, options: Emoji.ModifyParams): Promise<Emoji>;
|
|
60
|
-
/** https://discord.com/developers/docs/resources/emoji#delete-guild-emoji */
|
|
61
|
-
deleteGuildEmoji(guild_id: snowflake, emoji_id: snowflake): Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
}
|
package/lib/types/gateway.d.ts
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { Activity, integer, snowflake, StatusType } from '.';
|
|
2
|
-
/** https://discord.com/developers/docs/topics/gateway#payloads-gateway-payload-structure */
|
|
3
|
-
export interface GatewayPayloadStructure<O extends GatewayOpcode, T extends keyof GatewayEvents, D> {
|
|
4
|
-
/** opcode for the payload */
|
|
5
|
-
op: O;
|
|
6
|
-
/** event data */
|
|
7
|
-
d?: D;
|
|
8
|
-
/** the event name for this payload */
|
|
9
|
-
t?: T;
|
|
10
|
-
/** sequence number, used for resuming sessions and heartbeats */
|
|
11
|
-
s?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare type GatewayPayload = {
|
|
14
|
-
[O in GatewayOpcode]: O extends GatewayOpcode.DISPATCH ? {
|
|
15
|
-
[T in keyof GatewayEvents]: GatewayPayloadStructure<GatewayOpcode.DISPATCH, T, GatewayEvents[T]>;
|
|
16
|
-
}[keyof GatewayEvents] : GatewayPayloadStructure<O, never, O extends keyof GatewayParams ? GatewayParams[O] : never>;
|
|
17
|
-
}[GatewayOpcode];
|
|
18
|
-
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes */
|
|
19
|
-
export declare enum GatewayOpcode {
|
|
20
|
-
/** An event was dispatched. */
|
|
21
|
-
DISPATCH = 0,
|
|
22
|
-
/** Fired periodically by the client to keep the connection alive. */
|
|
23
|
-
HEARTBEAT = 1,
|
|
24
|
-
/** Starts a new session during the initial handshake. */
|
|
25
|
-
IDENTIFY = 2,
|
|
26
|
-
/** Update the client's presence. */
|
|
27
|
-
PRESENCE_UPDATE = 3,
|
|
28
|
-
/** Used to join/leave or move between voice channels. */
|
|
29
|
-
VOICE_STATE_UPDATE = 4,
|
|
30
|
-
/** Resume a previous session that was disconnected. */
|
|
31
|
-
RESUME = 6,
|
|
32
|
-
/** You should attempt to reconnect and resume immediately. */
|
|
33
|
-
RECONNECT = 7,
|
|
34
|
-
/** Request information about offline guild members in a large guild. */
|
|
35
|
-
REQUEST_GUILD_MEMBERS = 8,
|
|
36
|
-
/** The session has been invalidated. You should reconnect and identify/resume accordingly. */
|
|
37
|
-
INVALID_SESSION = 9,
|
|
38
|
-
/** Sent immediately after connecting, contains the `heartbeat_interval` to use. */
|
|
39
|
-
HELLO = 10,
|
|
40
|
-
/** Sent in response to receiving a heartbeat to acknowledge that it has been received. */
|
|
41
|
-
HEARTBEAT_ACK = 11
|
|
42
|
-
}
|
|
43
|
-
/** https://discord.com/developers/docs/topics/gateway#gateway-intents */
|
|
44
|
-
export declare enum GatewayIntent {
|
|
45
|
-
/**
|
|
46
|
-
* - GUILD_CREATE
|
|
47
|
-
* - GUILD_UPDATE
|
|
48
|
-
* - GUILD_DELETE
|
|
49
|
-
* - GUILD_ROLE_CREATE
|
|
50
|
-
* - GUILD_ROLE_UPDATE
|
|
51
|
-
* - GUILD_ROLE_DELETE
|
|
52
|
-
* - CHANNEL_CREATE
|
|
53
|
-
* - CHANNEL_UPDATE
|
|
54
|
-
* - CHANNEL_DELETE
|
|
55
|
-
* - CHANNEL_PINS_UPDATE
|
|
56
|
-
* - THREAD_CREATE
|
|
57
|
-
* - THREAD_UPDATE
|
|
58
|
-
* - THREAD_DELETE
|
|
59
|
-
* - THREAD_LIST_SYNC
|
|
60
|
-
* - THREAD_MEMBER_UPDATE
|
|
61
|
-
* - THREAD_MEMBERS_UPDATE
|
|
62
|
-
* - STAGE_INSTANCE_CREATE
|
|
63
|
-
* - STAGE_INSTANCE_UPDATE
|
|
64
|
-
* - STAGE_INSTANCE_DELETE
|
|
65
|
-
*/
|
|
66
|
-
GUILDS = 1,
|
|
67
|
-
/**
|
|
68
|
-
* - GUILD_MEMBER_ADD
|
|
69
|
-
* - GUILD_MEMBER_UPDATE
|
|
70
|
-
* - GUILD_MEMBER_REMOVE
|
|
71
|
-
* - THREAD_MEMBERS_UPDATE
|
|
72
|
-
*/
|
|
73
|
-
GUILD_MEMBERS = 2,
|
|
74
|
-
/**
|
|
75
|
-
* - GUILD_BAN_ADD
|
|
76
|
-
* - GUILD_BAN_REMOVE
|
|
77
|
-
*/
|
|
78
|
-
GUILD_BANS = 4,
|
|
79
|
-
/**
|
|
80
|
-
* - GUILD_EMOJIS_UPDATE
|
|
81
|
-
* - GUILD_STICKERS_UPDATE
|
|
82
|
-
*/
|
|
83
|
-
GUILD_EMOJIS_AND_STICKERS = 8,
|
|
84
|
-
/**
|
|
85
|
-
* - GUILD_INTEGRATIONS_UPDATE
|
|
86
|
-
* - INTEGRATION_CREATE
|
|
87
|
-
* - INTEGRATION_UPDATE
|
|
88
|
-
* - INTEGRATION_DELETE
|
|
89
|
-
*/
|
|
90
|
-
GUILD_INTEGRATIONS = 16,
|
|
91
|
-
/**
|
|
92
|
-
* - WEBHOOKS_UPDATE
|
|
93
|
-
*/
|
|
94
|
-
GUILD_WEBHOOKS = 32,
|
|
95
|
-
/**
|
|
96
|
-
* - INVITE_CREATE
|
|
97
|
-
* - INVITE_DELETE
|
|
98
|
-
*/
|
|
99
|
-
GUILD_INVITES = 64,
|
|
100
|
-
/**
|
|
101
|
-
* - VOICE_STATE_UPDATE
|
|
102
|
-
*/
|
|
103
|
-
GUILD_VOICE_STATES = 128,
|
|
104
|
-
/**
|
|
105
|
-
* - PRESENCE_UPDATE
|
|
106
|
-
*/
|
|
107
|
-
GUILD_PRESENCES = 256,
|
|
108
|
-
/**
|
|
109
|
-
* - MESSAGE_CREATE
|
|
110
|
-
* - MESSAGE_UPDATE
|
|
111
|
-
* - MESSAGE_DELETE
|
|
112
|
-
* - MESSAGE_DELETE_BULK
|
|
113
|
-
*/
|
|
114
|
-
GUILD_MESSAGES = 512,
|
|
115
|
-
/**
|
|
116
|
-
* - MESSAGE_REACTION_ADD
|
|
117
|
-
* - MESSAGE_REACTION_REMOVE
|
|
118
|
-
* - MESSAGE_REACTION_REMOVE_ALL
|
|
119
|
-
* - MESSAGE_REACTION_REMOVE_EMOJI
|
|
120
|
-
*/
|
|
121
|
-
GUILD_MESSAGE_REACTIONS = 1024,
|
|
122
|
-
/**
|
|
123
|
-
* - TYPING_START
|
|
124
|
-
*/
|
|
125
|
-
GUILD_MESSAGE_TYPING = 2048,
|
|
126
|
-
/**
|
|
127
|
-
* - MESSAGE_CREATE
|
|
128
|
-
* - MESSAGE_UPDATE
|
|
129
|
-
* - MESSAGE_DELETE
|
|
130
|
-
* - CHANNEL_PINS_UPDATE
|
|
131
|
-
*/
|
|
132
|
-
DIRECT_MESSAGES = 4096,
|
|
133
|
-
/**
|
|
134
|
-
* - MESSAGE_REACTION_ADD
|
|
135
|
-
* - MESSAGE_REACTION_REMOVE
|
|
136
|
-
* - MESSAGE_REACTION_REMOVE_ALL
|
|
137
|
-
* - MESSAGE_REACTION_REMOVE_EMOJI
|
|
138
|
-
*/
|
|
139
|
-
DIRECT_MESSAGE_REACTIONS = 8192,
|
|
140
|
-
/**
|
|
141
|
-
* - TYPING_START
|
|
142
|
-
*/
|
|
143
|
-
DIRECT_MESSAGE_TYPING = 16384
|
|
144
|
-
}
|
|
145
|
-
export interface GatewayParams {
|
|
146
|
-
[GatewayOpcode.HELLO]: HelloParams;
|
|
147
|
-
[GatewayOpcode.IDENTIFY]: IdentifyParams;
|
|
148
|
-
[GatewayOpcode.RESUME]: ResumeParams;
|
|
149
|
-
[GatewayOpcode.REQUEST_GUILD_MEMBERS]: RequestGuildMembersParams;
|
|
150
|
-
[GatewayOpcode.VOICE_STATE_UPDATE]: VoiceStateUpdateParams;
|
|
151
|
-
[GatewayOpcode.PRESENCE_UPDATE]: PresenceUpdateParams;
|
|
152
|
-
}
|
|
153
|
-
/** https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events */
|
|
154
|
-
export interface GatewayEvents {
|
|
155
|
-
}
|
|
156
|
-
/** https://discord.com/developers/docs/topics/gateway#identify-identify-structure */
|
|
157
|
-
export interface IdentifyParams {
|
|
158
|
-
/** authentication token */
|
|
159
|
-
token: string;
|
|
160
|
-
/** connection properties */
|
|
161
|
-
properties: object;
|
|
162
|
-
/** whether this connection supports compression of packets */
|
|
163
|
-
compress?: boolean;
|
|
164
|
-
/** value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list */
|
|
165
|
-
large_threshold?: integer;
|
|
166
|
-
/** used for Guild Sharding */
|
|
167
|
-
shard?: [shard_id: integer, num_shards: integer];
|
|
168
|
-
/** presence structure for initial presence information */
|
|
169
|
-
presence?: PresenceUpdateParams;
|
|
170
|
-
/** the Gateway Intents you wish to receive */
|
|
171
|
-
intents: integer;
|
|
172
|
-
}
|
|
173
|
-
/** https://discord.com/developers/docs/topics/gateway#resume-resume-structure */
|
|
174
|
-
export interface ResumeParams {
|
|
175
|
-
/** session token */
|
|
176
|
-
token: string;
|
|
177
|
-
/** session id */
|
|
178
|
-
session_id: string;
|
|
179
|
-
/** last sequence number received */
|
|
180
|
-
seq: integer;
|
|
181
|
-
}
|
|
182
|
-
/** https://discord.com/developers/docs/topics/gateway#request-guild-members-guild-request-members-structure */
|
|
183
|
-
export interface RequestGuildMembersParams {
|
|
184
|
-
/** id of the guild to get members for */
|
|
185
|
-
guild_id: snowflake;
|
|
186
|
-
/** string that username starts with, or an empty string to return all members */
|
|
187
|
-
query?: string;
|
|
188
|
-
/** maximum number of members to send matching the query; a limit of 0 can be used with an empty string query to return all members */
|
|
189
|
-
limit: integer;
|
|
190
|
-
/** used to specify if we want the presences of the matched members */
|
|
191
|
-
presences?: boolean;
|
|
192
|
-
/** used to specify which users you wish to fetch */
|
|
193
|
-
user_ids?: snowflake | snowflake[];
|
|
194
|
-
/** nonce to identify the Guild Members Chunk response */
|
|
195
|
-
nonce?: string;
|
|
196
|
-
}
|
|
197
|
-
/** https://discord.com/developers/docs/topics/gateway#update-voice-state-gateway-voice-state-update-structure */
|
|
198
|
-
export interface VoiceStateUpdateParams {
|
|
199
|
-
/** id of the guild */
|
|
200
|
-
guild_id: snowflake;
|
|
201
|
-
/** id of the voice channel client wants to join (null if disconnecting) */
|
|
202
|
-
channel_id?: snowflake;
|
|
203
|
-
/** is the client muted */
|
|
204
|
-
self_mute: boolean;
|
|
205
|
-
/** is the client deafened */
|
|
206
|
-
self_deaf: boolean;
|
|
207
|
-
}
|
|
208
|
-
/** https://discord.com/developers/docs/topics/gateway#update-presence-gateway-presence-update-structure */
|
|
209
|
-
export interface PresenceUpdateParams {
|
|
210
|
-
/** unix time (in milliseconds) of when the client went idle, or null if the client is not idle */
|
|
211
|
-
since?: integer;
|
|
212
|
-
/** the user's activities */
|
|
213
|
-
activities: Activity[];
|
|
214
|
-
/** the user's new status */
|
|
215
|
-
status: StatusType;
|
|
216
|
-
/** whether or not the client is afk */
|
|
217
|
-
afk: boolean;
|
|
218
|
-
}
|
|
219
|
-
/** https://discord.com/developers/docs/topics/gateway#hello-hello-structure */
|
|
220
|
-
export interface HelloParams {
|
|
221
|
-
/** the interval (in milliseconds) the client should heartbeat with */
|
|
222
|
-
heartbeat_interval: integer;
|
|
223
|
-
}
|
|
224
|
-
/** https://discord.com/developers/docs/topics/gateway#session-start-limit-object-session-start-limit-structure */
|
|
225
|
-
export interface SessionStartLimit {
|
|
226
|
-
/** The total number of session starts the current user is allowed */
|
|
227
|
-
total: integer;
|
|
228
|
-
/** The remaining number of session starts the current user is allowed */
|
|
229
|
-
remaining: integer;
|
|
230
|
-
/** The number of milliseconds after which the limit resets */
|
|
231
|
-
reset_after: integer;
|
|
232
|
-
/** The number of identify requests allowed per 5 seconds */
|
|
233
|
-
max_concurrency: integer;
|
|
234
|
-
}
|
|
235
|
-
declare module './internal' {
|
|
236
|
-
interface Internal {
|
|
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
|
-
*/
|
|
241
|
-
getGateway(): Promise<any>;
|
|
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
|
-
*/
|
|
246
|
-
getGatewayBot(): Promise<any>;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { integer, PresenceUpdateParams, snowflake, timestamp, User } from '.';
|
|
2
|
-
/** https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure */
|
|
3
|
-
export interface GuildMember {
|
|
4
|
-
/** the user this guild member represents */
|
|
5
|
-
user?: User;
|
|
6
|
-
/** this users guild nickname */
|
|
7
|
-
nick?: string;
|
|
8
|
-
/** the member's guild avatar hash */
|
|
9
|
-
avatar?: string;
|
|
10
|
-
/** array of role object ids */
|
|
11
|
-
roles: snowflake[];
|
|
12
|
-
/** when the user joined the guild */
|
|
13
|
-
joined_at: timestamp;
|
|
14
|
-
/** when the user started boosting the guild */
|
|
15
|
-
premium_since?: timestamp;
|
|
16
|
-
/** whether the user is deafened in voice channels */
|
|
17
|
-
deaf: boolean;
|
|
18
|
-
/** whether the user is muted in voice channels */
|
|
19
|
-
mute: boolean;
|
|
20
|
-
/** whether the user has not yet passed the guild's Membership Screening requirements */
|
|
21
|
-
pending?: boolean;
|
|
22
|
-
/** total permissions of the member in the channel, including overwrites, returned when in the interaction object */
|
|
23
|
-
permissions?: string;
|
|
24
|
-
}
|
|
25
|
-
export declare namespace GuildMember {
|
|
26
|
-
namespace Params {
|
|
27
|
-
/** https://discord.com/developers/docs/resources/guild#list-guild-members-query-string-params */
|
|
28
|
-
interface List {
|
|
29
|
-
/** max number of members to return (1-1000) */
|
|
30
|
-
limit: integer;
|
|
31
|
-
/** the highest user id in the previous page */
|
|
32
|
-
after: snowflake;
|
|
33
|
-
}
|
|
34
|
-
/** https://discord.com/developers/docs/resources/guild#search-guild-members-query-string-params */
|
|
35
|
-
interface Search {
|
|
36
|
-
/** Query string to match username(s) and nickname(s) against. */
|
|
37
|
-
query: string;
|
|
38
|
-
/** max number of members to return (1-1000) */
|
|
39
|
-
limit: integer;
|
|
40
|
-
}
|
|
41
|
-
/** https://discord.com/developers/docs/resources/guild#add-guild-member-json-params */
|
|
42
|
-
interface Add {
|
|
43
|
-
/** an oauth2 access token granted with the guilds.join to the bot's application for the user you want to add to the guild */
|
|
44
|
-
access_token: string;
|
|
45
|
-
/** value to set user's nickname to */
|
|
46
|
-
nick: string;
|
|
47
|
-
/** array of role ids the member is assigned */
|
|
48
|
-
roles: snowflake[];
|
|
49
|
-
/** whether the user is muted in voice channels */
|
|
50
|
-
mute: boolean;
|
|
51
|
-
/** whether the user is deafened in voice channels */
|
|
52
|
-
deaf: boolean;
|
|
53
|
-
}
|
|
54
|
-
/** https://discord.com/developers/docs/resources/guild#modify-guild-member-json-params */
|
|
55
|
-
interface Modify {
|
|
56
|
-
/** value to set user's nickname to */
|
|
57
|
-
nick: string;
|
|
58
|
-
/** array of role ids the member is assigned */
|
|
59
|
-
roles: snowflake[];
|
|
60
|
-
/** whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel */
|
|
61
|
-
mute: boolean;
|
|
62
|
-
/** whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel */
|
|
63
|
-
deaf: boolean;
|
|
64
|
-
/** id of channel to move user to (if they are connected to voice) */
|
|
65
|
-
channel_id: snowflake;
|
|
66
|
-
/** when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future), set to null to remove timeout */
|
|
67
|
-
communication_disabled_until?: timestamp;
|
|
68
|
-
}
|
|
69
|
-
/** https://discord.com/developers/docs/resources/guild#modify-current-member-json-params */
|
|
70
|
-
interface ModifyCurrent {
|
|
71
|
-
/** value to set user's nickname to */
|
|
72
|
-
nick?: string;
|
|
73
|
-
}
|
|
74
|
-
/** https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params */
|
|
75
|
-
interface GetPruneCount {
|
|
76
|
-
/** number of days to count prune for (1-30) */
|
|
77
|
-
days: integer;
|
|
78
|
-
/** role(s) to include */
|
|
79
|
-
include_roles: string;
|
|
80
|
-
}
|
|
81
|
-
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune-json-params */
|
|
82
|
-
interface BeginPrune {
|
|
83
|
-
/** number of days to prune (1-30) */
|
|
84
|
-
days: integer;
|
|
85
|
-
/** whether 'pruned' is returned, discouraged for large guilds */
|
|
86
|
-
compute_prune_count: boolean;
|
|
87
|
-
/** role(s) to include */
|
|
88
|
-
include_roles: snowflake[];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
namespace Event {
|
|
92
|
-
/** https://discord.com/developers/docs/topics/gateway#guild-member-add-guild-member-add-extra-fields */
|
|
93
|
-
interface Add extends GuildMember {
|
|
94
|
-
/** id of the guild */
|
|
95
|
-
guild_id: snowflake;
|
|
96
|
-
}
|
|
97
|
-
/** https://discord.com/developers/docs/topics/gateway#guild-member-remove-guild-member-remove-event-fields */
|
|
98
|
-
interface Remove {
|
|
99
|
-
/** the id of the guild */
|
|
100
|
-
guild_id: snowflake;
|
|
101
|
-
/** the user who was removed */
|
|
102
|
-
user: User;
|
|
103
|
-
}
|
|
104
|
-
/** https://discord.com/developers/docs/topics/gateway#guild-member-update-guild-member-update-event-fields */
|
|
105
|
-
interface Update {
|
|
106
|
-
/** the id of the guild */
|
|
107
|
-
guild_id: snowflake;
|
|
108
|
-
/** user role ids */
|
|
109
|
-
roles: snowflake[];
|
|
110
|
-
/** the user */
|
|
111
|
-
user: User;
|
|
112
|
-
/** nickname of the user in the guild */
|
|
113
|
-
nick?: string;
|
|
114
|
-
/** the member's guild avatar hash */
|
|
115
|
-
avatar?: string;
|
|
116
|
-
/** when the user joined the guild */
|
|
117
|
-
joined_at?: timestamp;
|
|
118
|
-
/** when the user starting boosting the guild */
|
|
119
|
-
premium_since?: timestamp;
|
|
120
|
-
/** whether the user is deafened in voice channels */
|
|
121
|
-
deaf?: boolean;
|
|
122
|
-
/** whether the user is muted in voice channels */
|
|
123
|
-
mute?: boolean;
|
|
124
|
-
/** whether the user has not yet passed the guild's Membership Screening requirements */
|
|
125
|
-
pending?: boolean;
|
|
126
|
-
}
|
|
127
|
-
/** https://discord.com/developers/docs/topics/gateway#guild-members-chunk-guild-members-chunk-event-fields */
|
|
128
|
-
interface Chunk {
|
|
129
|
-
/** the id of the guild */
|
|
130
|
-
guild_id: snowflake;
|
|
131
|
-
/** set of guild members */
|
|
132
|
-
members: GuildMember[];
|
|
133
|
-
/** the chunk index in the expected chunks for this response (0 <= chunk_index < chunk_count) */
|
|
134
|
-
chunk_index: integer;
|
|
135
|
-
/** the total number of expected chunks for this response */
|
|
136
|
-
chunk_count: integer;
|
|
137
|
-
/** if passing an invalid id to REQUEST_GUILD_MEMBERS, it will be returned here */
|
|
138
|
-
not_found?: snowflake[];
|
|
139
|
-
/** if passing true to REQUEST_GUILD_MEMBERS, presences of the returned members will be here */
|
|
140
|
-
presences?: PresenceUpdateParams[];
|
|
141
|
-
/** the nonce used in the Guild Members Request */
|
|
142
|
-
nonce?: string;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
declare module './gateway' {
|
|
147
|
-
interface GatewayEvents {
|
|
148
|
-
/** new user joined a guild */
|
|
149
|
-
GUILD_MEMBER_ADD: GuildMember.Event.Add;
|
|
150
|
-
/** user was removed from a guild */
|
|
151
|
-
GUILD_MEMBER_REMOVE: GuildMember.Event.Remove;
|
|
152
|
-
/** guild member was updated */
|
|
153
|
-
GUILD_MEMBER_UPDATE: GuildMember.Event.Update;
|
|
154
|
-
/** response to Request Guild Members */
|
|
155
|
-
GUILD_MEMBERS_CHUNK: GuildMember.Event.Chunk;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
declare module './internal' {
|
|
159
|
-
interface Internal {
|
|
160
|
-
/**
|
|
161
|
-
* Returns a guild member object for the specified user.
|
|
162
|
-
* @see https://discord.com/developers/docs/resources/guild#get-guild-member
|
|
163
|
-
*/
|
|
164
|
-
getGuildMember(guild_id: snowflake, user_id: snowflake): Promise<GuildMember>;
|
|
165
|
-
/**
|
|
166
|
-
* Returns a list of guild member objects that are members of the guild.
|
|
167
|
-
* @see https://discord.com/developers/docs/resources/guild#list-guild-members
|
|
168
|
-
*/
|
|
169
|
-
listGuildMembers(guild_id: snowflake, params?: GuildMember.Params.List): Promise<GuildMember[]>;
|
|
170
|
-
/**
|
|
171
|
-
* Returns a list of guild member objects whose username or nickname starts with a provided string.
|
|
172
|
-
* @see https://discord.com/developers/docs/resources/guild#search-guild-members
|
|
173
|
-
*/
|
|
174
|
-
searchGuildMembers(guild_id: snowflake, params?: GuildMember.Params.Search): Promise<GuildMember[]>;
|
|
175
|
-
/**
|
|
176
|
-
* Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope. Returns a 201 Created with the guild member as the body, or 204 No Content if the user is already a member of the guild. Fires a Guild Member Add Gateway event.
|
|
177
|
-
* @see https://discord.com/developers/docs/resources/guild#add-guild-member
|
|
178
|
-
*/
|
|
179
|
-
addGuildMember(guild_id: snowflake, user_id: snowflake, params: GuildMember.Params.Add): Promise<void>;
|
|
180
|
-
/**
|
|
181
|
-
* Modify attributes of a guild member. Returns a 200 OK with the guild member as the body. Fires a Guild Member Update Gateway event. If the channel_id is set to null, this will force the target user to be disconnected from voice.
|
|
182
|
-
* @see https://discord.com/developers/docs/resources/guild#modify-guild-member
|
|
183
|
-
*/
|
|
184
|
-
modifyGuildMember(guild_id: snowflake, user_id: snowflake, params: GuildMember.Params.Modify): Promise<void>;
|
|
185
|
-
/**
|
|
186
|
-
* Modifies the current member in a guild. Returns a 200 with the updated member object on success. Fires a Guild Member Update Gateway event.
|
|
187
|
-
* @see https://discord.com/developers/docs/resources/guild#modify-current-member
|
|
188
|
-
*/
|
|
189
|
-
modifyCurrentMember(guild_id: snowflake, params: GuildMember.Params.ModifyCurrent): Promise<void>;
|
|
190
|
-
/**
|
|
191
|
-
* Adds a role to a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Member Update Gateway event.
|
|
192
|
-
* @see https://discord.com/developers/docs/resources/guild#add-guild-member-role
|
|
193
|
-
*/
|
|
194
|
-
addGuildMemberRole(guild_id: snowflake, user_id: snowflake, role_id: snowflake): Promise<void>;
|
|
195
|
-
/**
|
|
196
|
-
* Removes a role from a guild member. Requires the MANAGE_ROLES permission. Returns a 204 empty response on success. Fires a Guild Member Update Gateway event.
|
|
197
|
-
* @see https://discord.com/developers/docs/resources/guild#remove-guild-member-role
|
|
198
|
-
*/
|
|
199
|
-
removeGuildMemberRole(guild_id: snowflake, user_id: snowflake, role_id: snowflake): Promise<void>;
|
|
200
|
-
/**
|
|
201
|
-
* Remove a member from a guild. Requires KICK_MEMBERS permission. Returns a 204 empty response on success. Fires a Guild Member Remove Gateway event.
|
|
202
|
-
* @see https://discord.com/developers/docs/resources/guild#remove-guild-member
|
|
203
|
-
*/
|
|
204
|
-
removeGuildMember(guild_id: snowflake, user_id: snowflake): Promise<void>;
|
|
205
|
-
/**
|
|
206
|
-
* Returns an object with one 'pruned' key indicating the number of members that would be removed in a prune operation. Requires the KICK_MEMBERS permission.
|
|
207
|
-
* @see https://discord.com/developers/docs/resources/guild#get-guild-prune-count
|
|
208
|
-
*/
|
|
209
|
-
getGuildPruneCount(guild_id: snowflake, params?: GuildMember.Params.GetPruneCount): Promise<void>;
|
|
210
|
-
/**
|
|
211
|
-
* Begin a prune operation. Requires the KICK_MEMBERS permission. Returns an object with one 'pruned' key indicating the number of members that were removed in the prune operation. For large guilds it's recommended to set the compute_prune_count option to false, forcing 'pruned' to null. Fires multiple Guild Member Remove Gateway events.
|
|
212
|
-
* @see https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
|
213
|
-
*/
|
|
214
|
-
beginGuildPrune(guild_id: snowflake, params: GuildMember.Params.BeginPrune): Promise<void>;
|
|
215
|
-
}
|
|
216
|
-
}
|