@satorijs/adapter-discord 3.7.1 → 3.8.1
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 +5 -1
- package/lib/index.d.ts +8 -3
- package/lib/index.js +1165 -968
- package/lib/index.js.map +4 -4
- package/lib/message.d.ts +1 -0
- package/lib/types/gateway.d.ts +268 -264
- package/lib/types/guild-member.d.ts +2 -2
- package/lib/types/index.d.ts +2 -1
- package/lib/types/interaction.d.ts +96 -89
- package/lib/utils.d.ts +10 -7
- package/package.json +2 -2
package/lib/message.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare class DiscordMessageEncoder extends MessageEncoder<DiscordBot> {
|
|
|
6
6
|
private addition;
|
|
7
7
|
private figure;
|
|
8
8
|
private mode;
|
|
9
|
+
private getUrl;
|
|
9
10
|
post(data?: any, headers?: any): any;
|
|
10
11
|
sendEmbed(attrs: Dict, payload: Dict): Promise<any>;
|
|
11
12
|
sendAsset(type: string, attrs: Dict<string>, addition: Dict): Promise<any>;
|
package/lib/types/gateway.d.ts
CHANGED
|
@@ -1,272 +1,276 @@
|
|
|
1
1
|
import { Activity, integer, snowflake, StatusType } from '.';
|
|
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
|
-
|
|
2
|
+
export declare namespace Gateway {
|
|
3
|
+
/** https://discord.com/developers/docs/topics/gateway-events#payload-structure */
|
|
4
|
+
interface PayloadStructure<O extends Opcode, T extends keyof GatewayEvents, D> {
|
|
5
|
+
/** opcode for the payload */
|
|
6
|
+
op: O;
|
|
7
|
+
/** event data */
|
|
8
|
+
d?: D;
|
|
9
|
+
/** the event name for this payload */
|
|
10
|
+
t?: T;
|
|
11
|
+
/** sequence number, used for resuming sessions and heartbeats */
|
|
12
|
+
s?: number;
|
|
13
|
+
}
|
|
14
|
+
type Payload = {
|
|
15
|
+
[O in Opcode]: O extends Opcode.DISPATCH ? {
|
|
16
|
+
[T in keyof GatewayEvents]: PayloadStructure<Opcode.DISPATCH, T, GatewayEvents[T]>;
|
|
17
|
+
}[keyof GatewayEvents] : PayloadStructure<O, never, O extends keyof Params ? Params[O] : never>;
|
|
18
|
+
}[Opcode];
|
|
19
|
+
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes */
|
|
20
|
+
enum Opcode {
|
|
21
|
+
/** An event was dispatched. */
|
|
22
|
+
DISPATCH = 0,
|
|
23
|
+
/** Fired periodically by the client to keep the connection alive. */
|
|
24
|
+
HEARTBEAT = 1,
|
|
25
|
+
/** Starts a new session during the initial handshake. */
|
|
26
|
+
IDENTIFY = 2,
|
|
27
|
+
/** Update the client's presence. */
|
|
28
|
+
PRESENCE_UPDATE = 3,
|
|
29
|
+
/** Used to join/leave or move between voice channels. */
|
|
30
|
+
VOICE_STATE_UPDATE = 4,
|
|
31
|
+
/** Resume a previous session that was disconnected. */
|
|
32
|
+
RESUME = 6,
|
|
33
|
+
/** You should attempt to reconnect and resume immediately. */
|
|
34
|
+
RECONNECT = 7,
|
|
35
|
+
/** Request information about offline guild members in a large guild. */
|
|
36
|
+
REQUEST_GUILD_MEMBERS = 8,
|
|
37
|
+
/** The session has been invalidated. You should reconnect and identify/resume accordingly. */
|
|
38
|
+
INVALID_SESSION = 9,
|
|
39
|
+
/** Sent immediately after connecting, contains the `heartbeat_interval` to use. */
|
|
40
|
+
HELLO = 10,
|
|
41
|
+
/** Sent in response to receiving a heartbeat to acknowledge that it has been received. */
|
|
42
|
+
HEARTBEAT_ACK = 11
|
|
43
|
+
}
|
|
44
|
+
/** https://discord.com/developers/docs/topics/gateway#gateway-intents */
|
|
45
|
+
enum Intent {
|
|
46
|
+
/**
|
|
47
|
+
* - GUILD_CREATE
|
|
48
|
+
* - GUILD_UPDATE
|
|
49
|
+
* - GUILD_DELETE
|
|
50
|
+
* - GUILD_ROLE_CREATE
|
|
51
|
+
* - GUILD_ROLE_UPDATE
|
|
52
|
+
* - GUILD_ROLE_DELETE
|
|
53
|
+
* - CHANNEL_CREATE
|
|
54
|
+
* - CHANNEL_UPDATE
|
|
55
|
+
* - CHANNEL_DELETE
|
|
56
|
+
* - CHANNEL_PINS_UPDATE
|
|
57
|
+
* - THREAD_CREATE
|
|
58
|
+
* - THREAD_UPDATE
|
|
59
|
+
* - THREAD_DELETE
|
|
60
|
+
* - THREAD_LIST_SYNC
|
|
61
|
+
* - THREAD_MEMBER_UPDATE
|
|
62
|
+
* - THREAD_MEMBERS_UPDATE
|
|
63
|
+
* - STAGE_INSTANCE_CREATE
|
|
64
|
+
* - STAGE_INSTANCE_UPDATE
|
|
65
|
+
* - STAGE_INSTANCE_DELETE
|
|
66
|
+
*/
|
|
67
|
+
GUILDS = 1,
|
|
68
|
+
/**
|
|
69
|
+
* - GUILD_MEMBER_ADD
|
|
70
|
+
* - GUILD_MEMBER_UPDATE
|
|
71
|
+
* - GUILD_MEMBER_REMOVE
|
|
72
|
+
* - THREAD_MEMBERS_UPDATE
|
|
73
|
+
*/
|
|
74
|
+
GUILD_MEMBERS = 2,
|
|
75
|
+
/**
|
|
76
|
+
* - GUILD_BAN_ADD
|
|
77
|
+
* - GUILD_BAN_REMOVE
|
|
78
|
+
*/
|
|
79
|
+
GUILD_BANS = 4,
|
|
80
|
+
/**
|
|
81
|
+
* - GUILD_EMOJIS_UPDATE
|
|
82
|
+
* - GUILD_STICKERS_UPDATE
|
|
83
|
+
*/
|
|
84
|
+
GUILD_EMOJIS_AND_STICKERS = 8,
|
|
85
|
+
/**
|
|
86
|
+
* - GUILD_INTEGRATIONS_UPDATE
|
|
87
|
+
* - INTEGRATION_CREATE
|
|
88
|
+
* - INTEGRATION_UPDATE
|
|
89
|
+
* - INTEGRATION_DELETE
|
|
90
|
+
*/
|
|
91
|
+
GUILD_INTEGRATIONS = 16,
|
|
92
|
+
/**
|
|
93
|
+
* - WEBHOOKS_UPDATE
|
|
94
|
+
*/
|
|
95
|
+
GUILD_WEBHOOKS = 32,
|
|
96
|
+
/**
|
|
97
|
+
* - INVITE_CREATE
|
|
98
|
+
* - INVITE_DELETE
|
|
99
|
+
*/
|
|
100
|
+
GUILD_INVITES = 64,
|
|
101
|
+
/**
|
|
102
|
+
* - VOICE_STATE_UPDATE
|
|
103
|
+
*/
|
|
104
|
+
GUILD_VOICE_STATES = 128,
|
|
105
|
+
/**
|
|
106
|
+
* - PRESENCE_UPDATE
|
|
107
|
+
*/
|
|
108
|
+
GUILD_PRESENCES = 256,
|
|
109
|
+
/**
|
|
110
|
+
* - MESSAGE_CREATE
|
|
111
|
+
* - MESSAGE_UPDATE
|
|
112
|
+
* - MESSAGE_DELETE
|
|
113
|
+
* - MESSAGE_DELETE_BULK
|
|
114
|
+
*/
|
|
115
|
+
GUILD_MESSAGES = 512,
|
|
116
|
+
/**
|
|
117
|
+
* - MESSAGE_REACTION_ADD
|
|
118
|
+
* - MESSAGE_REACTION_REMOVE
|
|
119
|
+
* - MESSAGE_REACTION_REMOVE_ALL
|
|
120
|
+
* - MESSAGE_REACTION_REMOVE_EMOJI
|
|
121
|
+
*/
|
|
122
|
+
GUILD_MESSAGE_REACTIONS = 1024,
|
|
123
|
+
/**
|
|
124
|
+
* - TYPING_START
|
|
125
|
+
*/
|
|
126
|
+
GUILD_MESSAGE_TYPING = 2048,
|
|
127
|
+
/**
|
|
128
|
+
* - MESSAGE_CREATE
|
|
129
|
+
* - MESSAGE_UPDATE
|
|
130
|
+
* - MESSAGE_DELETE
|
|
131
|
+
* - CHANNEL_PINS_UPDATE
|
|
132
|
+
*/
|
|
133
|
+
DIRECT_MESSAGES = 4096,
|
|
134
|
+
/**
|
|
135
|
+
* - MESSAGE_REACTION_ADD
|
|
136
|
+
* - MESSAGE_REACTION_REMOVE
|
|
137
|
+
* - MESSAGE_REACTION_REMOVE_ALL
|
|
138
|
+
* - MESSAGE_REACTION_REMOVE_EMOJI
|
|
139
|
+
*/
|
|
140
|
+
DIRECT_MESSAGE_REACTIONS = 8192,
|
|
141
|
+
/**
|
|
142
|
+
* - TYPING_START
|
|
143
|
+
*/
|
|
144
|
+
DIRECT_MESSAGE_TYPING = 16384,
|
|
145
|
+
/**
|
|
146
|
+
* `MESSAGE_CONTENT` is a unique privileged intent that isn't directly associated with any Gateway events.
|
|
147
|
+
* Instead, access to `MESSAGE_CONTENT` permits your app to receive message content data across the APIs.
|
|
148
|
+
*
|
|
149
|
+
* Any fields affected by the message content intent are noted in the relevant documentation.
|
|
150
|
+
* For example, the content, embeds, attachments, and components fields in message objects all contain message content and therefore require the intent.
|
|
151
|
+
*
|
|
152
|
+
* Like other privileged intents, `MESSAGE_CONTENT` must be approved for your app.
|
|
153
|
+
* After your app is verified, you can apply for the intent from your app's settings within the Developer Portal.
|
|
154
|
+
* You can read more about the message content intent review policy in the [Help Center](https://support-dev.discord.com/hc/en-us/articles/5324827539479).
|
|
155
|
+
*
|
|
156
|
+
* Apps without the intent will receive empty values in fields that contain user-inputted content with a few exceptions:
|
|
157
|
+
* - Content in messages that an app sends
|
|
158
|
+
* - Content in DMs with the app
|
|
159
|
+
* - Content in which the app is mentioned
|
|
160
|
+
*
|
|
161
|
+
* @see https://discord.com/developers/docs/topics/gateway#message-content-intent
|
|
162
|
+
*/
|
|
163
|
+
MESSAGE_CONTENT = 32768,
|
|
164
|
+
/**
|
|
165
|
+
* - GUILD_SCHEDULED_EVENT_CREATE
|
|
166
|
+
* - GUILD_SCHEDULED_EVENT_UPDATE
|
|
167
|
+
* - GUILD_SCHEDULED_EVENT_DELETE
|
|
168
|
+
* - GUILD_SCHEDULED_EVENT_USER_ADD
|
|
169
|
+
* - GUILD_SCHEDULED_EVENT_USER_REMOVE
|
|
170
|
+
*/
|
|
171
|
+
GUILD_SCHEDULED_EVENTS = 65536,
|
|
172
|
+
/**
|
|
173
|
+
* - AUTO_MODERATION_RULE_CREATE
|
|
174
|
+
* - AUTO_MODERATION_RULE_UPDATE
|
|
175
|
+
* - AUTO_MODERATION_RULE_DELETE
|
|
176
|
+
*/
|
|
177
|
+
AUTO_MODERATION_CONFIGURATION = 1048576,
|
|
178
|
+
/**
|
|
179
|
+
* - AUTO_MODERATION_ACTION_EXECUTION
|
|
180
|
+
*/
|
|
181
|
+
AUTO_MODERATION_EXECUTION = 2097152
|
|
182
|
+
}
|
|
183
|
+
interface Params {
|
|
184
|
+
[Opcode.HELLO]: Params.Hello;
|
|
185
|
+
[Opcode.IDENTIFY]: Params.Identify;
|
|
186
|
+
[Opcode.RESUME]: Params.Resume;
|
|
187
|
+
[Opcode.REQUEST_GUILD_MEMBERS]: Params.RequestGuildMembers;
|
|
188
|
+
[Opcode.VOICE_STATE_UPDATE]: Params.VoiceStateUpdate;
|
|
189
|
+
[Opcode.PRESENCE_UPDATE]: Params.PresenceUpdate;
|
|
190
|
+
}
|
|
191
|
+
namespace Params {
|
|
192
|
+
/** https://discord.com/developers/docs/topics/gateway-events#hello-hello-structure */
|
|
193
|
+
interface Hello {
|
|
194
|
+
/** the interval (in milliseconds) the client should heartbeat with */
|
|
195
|
+
heartbeat_interval: integer;
|
|
196
|
+
}
|
|
197
|
+
/** https://discord.com/developers/docs/topics/gateway-events#identify-identify-structure */
|
|
198
|
+
interface Identify {
|
|
199
|
+
/** authentication token */
|
|
200
|
+
token: string;
|
|
201
|
+
/** connection properties */
|
|
202
|
+
properties: ConnectionProperties;
|
|
203
|
+
/** whether this connection supports compression of packets */
|
|
204
|
+
compress?: boolean;
|
|
205
|
+
/** value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list */
|
|
206
|
+
large_threshold?: integer;
|
|
207
|
+
/** used for Guild Sharding */
|
|
208
|
+
shard?: [shard_id: integer, num_shards: integer];
|
|
209
|
+
/** presence structure for initial presence information */
|
|
210
|
+
presence?: PresenceUpdate;
|
|
211
|
+
/** the Gateway Intents you wish to receive */
|
|
212
|
+
intents: integer;
|
|
213
|
+
}
|
|
214
|
+
/** https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties */
|
|
215
|
+
interface ConnectionProperties {
|
|
216
|
+
/** Your operating system */
|
|
217
|
+
os: string;
|
|
218
|
+
/** Your library name */
|
|
219
|
+
browser: string;
|
|
220
|
+
/** Your library name */
|
|
221
|
+
device: string;
|
|
222
|
+
}
|
|
223
|
+
/** https://discord.com/developers/docs/topics/gateway-events#resume-resume-structure */
|
|
224
|
+
interface Resume {
|
|
225
|
+
/** session token */
|
|
226
|
+
token: string;
|
|
227
|
+
/** session id */
|
|
228
|
+
session_id: string;
|
|
229
|
+
/** last sequence number received */
|
|
230
|
+
seq: integer;
|
|
231
|
+
}
|
|
232
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-guild-members-guild-request-members-structure */
|
|
233
|
+
interface RequestGuildMembers {
|
|
234
|
+
/** id of the guild to get members for */
|
|
235
|
+
guild_id: snowflake;
|
|
236
|
+
/** string that username starts with, or an empty string to return all members */
|
|
237
|
+
query?: string;
|
|
238
|
+
/** 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 */
|
|
239
|
+
limit: integer;
|
|
240
|
+
/** used to specify if we want the presences of the matched members */
|
|
241
|
+
presences?: boolean;
|
|
242
|
+
/** used to specify which users you wish to fetch */
|
|
243
|
+
user_ids?: snowflake | snowflake[];
|
|
244
|
+
/** nonce to identify the Guild Members Chunk response */
|
|
245
|
+
nonce?: string;
|
|
246
|
+
}
|
|
247
|
+
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state-gateway-voice-state-update-structure */
|
|
248
|
+
interface VoiceStateUpdate {
|
|
249
|
+
/** id of the guild */
|
|
250
|
+
guild_id: snowflake;
|
|
251
|
+
/** id of the voice channel client wants to join (null if disconnecting) */
|
|
252
|
+
channel_id?: snowflake;
|
|
253
|
+
/** is the client muted */
|
|
254
|
+
self_mute: boolean;
|
|
255
|
+
/** is the client deafened */
|
|
256
|
+
self_deaf: boolean;
|
|
257
|
+
}
|
|
258
|
+
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure */
|
|
259
|
+
interface PresenceUpdate {
|
|
260
|
+
/** unix time (in milliseconds) of when the client went idle, or null if the client is not idle */
|
|
261
|
+
since?: integer;
|
|
262
|
+
/** the user's activities */
|
|
263
|
+
activities: Activity[];
|
|
264
|
+
/** the user's new status */
|
|
265
|
+
status: StatusType;
|
|
266
|
+
/** whether or not the client is afk */
|
|
267
|
+
afk: boolean;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
189
270
|
}
|
|
190
271
|
/** https://discord.com/developers/docs/topics/gateway-events#gateway-events */
|
|
191
272
|
export interface GatewayEvents {
|
|
192
273
|
}
|
|
193
|
-
/** https://discord.com/developers/docs/topics/gateway-events#identify-identify-structure */
|
|
194
|
-
export interface IdentifyParams {
|
|
195
|
-
/** authentication token */
|
|
196
|
-
token: string;
|
|
197
|
-
/** connection properties */
|
|
198
|
-
properties: ConnectionProperties;
|
|
199
|
-
/** whether this connection supports compression of packets */
|
|
200
|
-
compress?: boolean;
|
|
201
|
-
/** value between 50 and 250, total number of members where the gateway will stop sending offline members in the guild member list */
|
|
202
|
-
large_threshold?: integer;
|
|
203
|
-
/** used for Guild Sharding */
|
|
204
|
-
shard?: [shard_id: integer, num_shards: integer];
|
|
205
|
-
/** presence structure for initial presence information */
|
|
206
|
-
presence?: PresenceUpdateParams;
|
|
207
|
-
/** the Gateway Intents you wish to receive */
|
|
208
|
-
intents: integer;
|
|
209
|
-
}
|
|
210
|
-
/** https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties */
|
|
211
|
-
export interface ConnectionProperties {
|
|
212
|
-
/** Your operating system */
|
|
213
|
-
os: string;
|
|
214
|
-
/** Your library name */
|
|
215
|
-
browser: string;
|
|
216
|
-
/** Your library name */
|
|
217
|
-
device: string;
|
|
218
|
-
}
|
|
219
|
-
/** https://discord.com/developers/docs/topics/gateway-events#resume-resume-structure */
|
|
220
|
-
export interface ResumeParams {
|
|
221
|
-
/** session token */
|
|
222
|
-
token: string;
|
|
223
|
-
/** session id */
|
|
224
|
-
session_id: string;
|
|
225
|
-
/** last sequence number received */
|
|
226
|
-
seq: integer;
|
|
227
|
-
}
|
|
228
|
-
/** https://discord.com/developers/docs/topics/gateway-events#request-guild-members-guild-request-members-structure */
|
|
229
|
-
export interface RequestGuildMembersParams {
|
|
230
|
-
/** id of the guild to get members for */
|
|
231
|
-
guild_id: snowflake;
|
|
232
|
-
/** string that username starts with, or an empty string to return all members */
|
|
233
|
-
query?: string;
|
|
234
|
-
/** 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 */
|
|
235
|
-
limit: integer;
|
|
236
|
-
/** used to specify if we want the presences of the matched members */
|
|
237
|
-
presences?: boolean;
|
|
238
|
-
/** used to specify which users you wish to fetch */
|
|
239
|
-
user_ids?: snowflake | snowflake[];
|
|
240
|
-
/** nonce to identify the Guild Members Chunk response */
|
|
241
|
-
nonce?: string;
|
|
242
|
-
}
|
|
243
|
-
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state-gateway-voice-state-update-structure */
|
|
244
|
-
export interface VoiceStateUpdateParams {
|
|
245
|
-
/** id of the guild */
|
|
246
|
-
guild_id: snowflake;
|
|
247
|
-
/** id of the voice channel client wants to join (null if disconnecting) */
|
|
248
|
-
channel_id?: snowflake;
|
|
249
|
-
/** is the client muted */
|
|
250
|
-
self_mute: boolean;
|
|
251
|
-
/** is the client deafened */
|
|
252
|
-
self_deaf: boolean;
|
|
253
|
-
}
|
|
254
|
-
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure */
|
|
255
|
-
export interface PresenceUpdateParams {
|
|
256
|
-
/** unix time (in milliseconds) of when the client went idle, or null if the client is not idle */
|
|
257
|
-
since?: integer;
|
|
258
|
-
/** the user's activities */
|
|
259
|
-
activities: Activity[];
|
|
260
|
-
/** the user's new status */
|
|
261
|
-
status: StatusType;
|
|
262
|
-
/** whether or not the client is afk */
|
|
263
|
-
afk: boolean;
|
|
264
|
-
}
|
|
265
|
-
/** https://discord.com/developers/docs/topics/gateway-events#hello-hello-structure */
|
|
266
|
-
export interface HelloParams {
|
|
267
|
-
/** the interval (in milliseconds) the client should heartbeat with */
|
|
268
|
-
heartbeat_interval: integer;
|
|
269
|
-
}
|
|
270
274
|
/** https://discord.com/developers/docs/topics/gateway-events#session-start-limit-object-session-start-limit-structure */
|
|
271
275
|
export interface SessionStartLimit {
|
|
272
276
|
/** The total number of session starts the current user is allowed */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gateway, integer, snowflake, timestamp, User } from '.';
|
|
2
2
|
/** https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure */
|
|
3
3
|
export interface GuildMember {
|
|
4
4
|
/** the user this guild member represents */
|
|
@@ -141,7 +141,7 @@ export declare namespace GuildMember {
|
|
|
141
141
|
/** if passing an invalid id to REQUEST_GUILD_MEMBERS, it will be returned here */
|
|
142
142
|
not_found?: snowflake[];
|
|
143
143
|
/** if passing true to REQUEST_GUILD_MEMBERS, presences of the returned members will be here */
|
|
144
|
-
presences?:
|
|
144
|
+
presences?: Gateway.Params.PresenceUpdate[];
|
|
145
145
|
/** the nonce used in the Guild Members Request */
|
|
146
146
|
nonce?: string;
|
|
147
147
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -32,4 +32,5 @@ export type integer = number;
|
|
|
32
32
|
export type snowflake = string;
|
|
33
33
|
export type timestamp = string;
|
|
34
34
|
/** @see https://discord.com/developers/docs/reference#locales */
|
|
35
|
-
export type Locale =
|
|
35
|
+
export type Locale = typeof Locale[number];
|
|
36
|
+
export declare const Locale: readonly ["da", "de", "en-GB", "en-US", "es-ES", "fr", "hr", "it", "lt", "hu", "nl", "no", "pl", "pt-BR", "ro", "fi", "sv-SE", "vi", "tr", "cs", "el", "bg", "ru", "uk", "hi", "th", "zh-CN", "ja", "zh-TW", "ko"];
|