snowtransfer 0.17.7 → 0.18.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/CHANGELOG.md +60 -0
- package/LICENSE.md +1 -1
- package/README.md +4 -5
- package/dist/Constants.d.ts +59 -0
- package/dist/Constants.js +123 -0
- package/dist/Endpoints.d.ts +120 -0
- package/dist/Endpoints.js +121 -0
- package/dist/RequestHandler.d.ts +258 -0
- package/dist/RequestHandler.js +629 -0
- package/dist/SnowTransfer.d.ts +70 -0
- package/dist/SnowTransfer.js +105 -0
- package/dist/StateMachine.d.ts +89 -0
- package/dist/StateMachine.js +208 -0
- package/dist/StateMachineGraph.d.ts +3 -0
- package/dist/StateMachineGraph.js +23 -0
- package/dist/Types.d.ts +76 -0
- package/dist/Types.js +2 -0
- package/dist/index.d.ts +25 -4102
- package/dist/index.js +63 -46
- package/dist/methods/Assets.d.ts +290 -0
- package/dist/methods/Assets.js +326 -0
- package/dist/methods/AuditLog.d.ts +40 -0
- package/dist/methods/AuditLog.js +44 -0
- package/dist/methods/AutoModeration.d.ts +122 -0
- package/dist/methods/AutoModeration.js +135 -0
- package/dist/methods/Bot.d.ts +65 -0
- package/dist/methods/Bot.js +75 -0
- package/dist/methods/Channel.d.ts +866 -0
- package/dist/methods/Channel.js +982 -0
- package/dist/methods/Entitlements.d.ts +87 -0
- package/dist/methods/Entitlements.js +99 -0
- package/dist/methods/Guild.d.ts +722 -0
- package/dist/methods/Guild.js +785 -0
- package/dist/methods/GuildScheduledEvent.d.ts +138 -0
- package/dist/methods/GuildScheduledEvent.js +155 -0
- package/dist/methods/GuildTemplate.d.ts +110 -0
- package/dist/methods/GuildTemplate.js +124 -0
- package/dist/methods/Interaction.d.ts +339 -0
- package/dist/methods/Interaction.js +359 -0
- package/dist/methods/Invite.d.ts +81 -0
- package/dist/methods/Invite.js +107 -0
- package/dist/methods/Sku.d.ts +58 -0
- package/dist/methods/Sku.js +66 -0
- package/dist/methods/StageInstance.d.ts +86 -0
- package/dist/methods/StageInstance.js +97 -0
- package/dist/methods/User.d.ts +167 -0
- package/dist/methods/User.js +184 -0
- package/dist/methods/Voice.d.ts +44 -0
- package/dist/methods/Voice.js +52 -0
- package/dist/methods/Webhook.d.ts +265 -0
- package/dist/methods/Webhook.js +256 -0
- package/dist/tokenless.d.ts +19 -0
- package/dist/tokenless.js +31 -0
- package/package.json +16 -11
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4105 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
error_message: string | null;
|
|
24
|
-
};
|
|
25
|
-
type RatelimitInfo = {
|
|
26
|
-
message: string;
|
|
27
|
-
retry_after: number;
|
|
28
|
-
global: boolean;
|
|
29
|
-
code?: number;
|
|
30
|
-
};
|
|
31
|
-
type RequestEventData = {
|
|
32
|
-
endpoint: string;
|
|
33
|
-
method: string;
|
|
34
|
-
dataType: "json" | "multipart";
|
|
35
|
-
data: any;
|
|
36
|
-
};
|
|
37
|
-
type HandlerEvents = {
|
|
38
|
-
request: [string, RequestEventData];
|
|
39
|
-
done: [string, Response, RequestEventData];
|
|
40
|
-
requestError: [string, Error];
|
|
41
|
-
rateLimit: [{
|
|
42
|
-
method: string;
|
|
43
|
-
path: string;
|
|
44
|
-
route: string;
|
|
45
|
-
}];
|
|
46
|
-
};
|
|
47
|
-
type SMState = {
|
|
48
|
-
onEnter: Array<(event: string) => unknown>;
|
|
49
|
-
onLeave: Array<(event: string) => unknown>;
|
|
50
|
-
transitions: Map<string, SMTransition>;
|
|
51
|
-
};
|
|
52
|
-
type SMTransition = {
|
|
53
|
-
destination: string;
|
|
54
|
-
onTransition?: Array<(...args: any[]) => unknown>;
|
|
55
|
-
};
|
|
56
|
-
type SMHistory = {
|
|
57
|
-
from: string;
|
|
58
|
-
event: string;
|
|
59
|
-
to: string;
|
|
60
|
-
time: number;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
interface StateMachineEvents {
|
|
64
|
-
enter: [string];
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Class used to define states code is expected to be in and transitions to other states and code to run during those transitions and states
|
|
68
|
-
* @since 0.16.0
|
|
69
|
-
*/
|
|
70
|
-
declare class StateMachine extends EventEmitter<StateMachineEvents> {
|
|
71
|
-
currentStateName: string;
|
|
72
|
-
readonly states: Map<string, SMState>;
|
|
73
|
-
private editable;
|
|
74
|
-
private readonly deferredTransitionCreators;
|
|
75
|
-
private readonly history;
|
|
76
|
-
/**
|
|
77
|
-
* Create a new StateMachine
|
|
78
|
-
* @param currentStateName The state this state machine is currently in. When constructing the StateMachine, this is the entry state.
|
|
79
|
-
*/
|
|
80
|
-
constructor(currentStateName: string);
|
|
81
|
-
/**
|
|
82
|
-
* Helper function that throws an Error when something tries to edit the state machine after it has been frozen/finalized.
|
|
83
|
-
* @since 0.16.0
|
|
84
|
-
*/
|
|
85
|
-
guardEditable(): void;
|
|
86
|
-
/**
|
|
87
|
-
* Helper function that throws an Error when something tries to use the state machine before it has been frozen/finalized.
|
|
88
|
-
* @since 0.16.0
|
|
89
|
-
*/
|
|
90
|
-
guardNotEditable(): void;
|
|
91
|
-
/**
|
|
92
|
-
* Define a state in the state machine.
|
|
93
|
-
* @since 0.16.0
|
|
94
|
-
* @param name The name of the state.
|
|
95
|
-
* @param cbs Callbacks for points during transitions relating to this state as well as transitions to other states.
|
|
96
|
-
*/
|
|
97
|
-
defineState(name: string, cbs?: {
|
|
98
|
-
onEnter: SMState["onEnter"];
|
|
99
|
-
onLeave: SMState["onLeave"];
|
|
100
|
-
transitions: Map<string, SMTransition>;
|
|
101
|
-
}): this;
|
|
102
|
-
/**
|
|
103
|
-
* Define a transition between 2 states in the state machine.
|
|
104
|
-
* @since 0.16.0
|
|
105
|
-
* @param from The name of the state this transition would come from.
|
|
106
|
-
* @param event The event that can trigger this transition.
|
|
107
|
-
* @param to The name of the state this transition would go to.
|
|
108
|
-
* @param cb A callback to run when this transition occurs.
|
|
109
|
-
*/
|
|
110
|
-
defineTransition(from: string, event: string, to: string, cb?: (...args: any[]) => unknown): this;
|
|
111
|
-
/**
|
|
112
|
-
* Define a transition from every state to another state in the state machine.
|
|
113
|
-
* @since 0.16.0
|
|
114
|
-
* @param event The event that can trigger this transition.
|
|
115
|
-
* @param to The name of the state this transition would go to.
|
|
116
|
-
* @param cb A callback to run when this transition occurs.
|
|
117
|
-
*/
|
|
118
|
-
defineUniversalTransition(event: string, to: string, cb?: (...args: any[]) => unknown): this;
|
|
119
|
-
/**
|
|
120
|
-
* Finalize the state machine, making its states and transitions now readonly and usable.
|
|
121
|
-
* @since 0.16.0
|
|
122
|
-
*/
|
|
123
|
-
freeze(): void;
|
|
124
|
-
/**
|
|
125
|
-
* Trigger an event to do a transition from the current state to another as defined previously.
|
|
126
|
-
*
|
|
127
|
-
* Will throw an Error if there is no transition from the current state to another based off the event.
|
|
128
|
-
* @since 0.16.0
|
|
129
|
-
* @param event The event that occured.
|
|
130
|
-
* @param args Arguments to pass to the callback of the transition's onTransition functions if any.
|
|
131
|
-
*/
|
|
132
|
-
doTransition(event: string, ...args: any[]): void;
|
|
133
|
-
/**
|
|
134
|
-
* Trigger an event to do a transition from the current state to another as defined previously at a later point in time.
|
|
135
|
-
*
|
|
136
|
-
* Will throw an Error if there is no transition from the current state to another based off the event.
|
|
137
|
-
* @since 0.16.0
|
|
138
|
-
* @param event The event that occured.
|
|
139
|
-
* @param delayMs The time in milliseconds this transition will run in.
|
|
140
|
-
* @param args Arguments to pass to the callback of the transition's onTransition functions if any.
|
|
141
|
-
*/
|
|
142
|
-
doTransitionLater(event: string, delayMs: number, ...args: Array<any>): void;
|
|
143
|
-
/**
|
|
144
|
-
* Print debug info about this state machine to stdout in the form of a table.
|
|
145
|
-
* @since 0.16.0
|
|
146
|
-
*/
|
|
147
|
-
debug(): void;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
declare global {
|
|
151
|
-
var snowtransferDebugLogging: boolean;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* @since 0.3.0
|
|
155
|
-
* @protected
|
|
156
|
-
*/
|
|
157
|
-
declare class DiscordAPIError extends Error {
|
|
158
|
-
method: string;
|
|
159
|
-
path: string;
|
|
160
|
-
code: number;
|
|
161
|
-
httpStatus: number;
|
|
162
|
-
request: RequestEventData;
|
|
163
|
-
response: Response;
|
|
164
|
-
constructor(error: {
|
|
165
|
-
message?: string;
|
|
166
|
-
code?: number;
|
|
167
|
-
}, request: RequestEventData, response: Response);
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* @since 0.17.0
|
|
171
|
-
*/
|
|
172
|
-
interface Counter {
|
|
173
|
-
id: string;
|
|
174
|
-
/**
|
|
175
|
-
* Like new.
|
|
176
|
-
* @since 0.17.0
|
|
177
|
-
*/
|
|
178
|
-
hasReset(): boolean;
|
|
179
|
-
/**
|
|
180
|
-
* Returns true only if the caller is allowed to call take() and then consume a function.
|
|
181
|
-
* @since 0.17.0
|
|
182
|
-
*/
|
|
183
|
-
canTake(): boolean;
|
|
184
|
-
/**
|
|
185
|
-
* Take a use out of the counter
|
|
186
|
-
* @since 0.17.0
|
|
187
|
-
*/
|
|
188
|
-
take(): boolean;
|
|
189
|
-
/** @since 0.17.0 */
|
|
190
|
-
timeUntilReset(): number;
|
|
191
|
-
/** @since 0.17.0 */
|
|
192
|
-
responseReceived(): void;
|
|
193
|
-
/** @since 0.17.0 */
|
|
194
|
-
applyCount(limit: number | null, remaining: number, resetAfter: number): void;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* @since 0.17.0
|
|
198
|
-
*/
|
|
199
|
-
declare class IntervalCounter implements Counter {
|
|
200
|
-
limit: number;
|
|
201
|
-
reset: number;
|
|
202
|
-
/**
|
|
203
|
-
* Remaining amount of executions during the current timeframe
|
|
204
|
-
*/
|
|
205
|
-
remaining: number;
|
|
206
|
-
private firstRequestTime;
|
|
207
|
-
private resetAt;
|
|
208
|
-
readonly id: string;
|
|
209
|
-
/**
|
|
210
|
-
* Create a new base bucket
|
|
211
|
-
* @param limit Number of functions that may be executed during the timeframe set in reset
|
|
212
|
-
* @param reset Timeframe in milliseconds until the ratelimit resets after first
|
|
213
|
-
*/
|
|
214
|
-
constructor(limit: number, reset: number);
|
|
215
|
-
private checkReset;
|
|
216
|
-
hasReset(): boolean;
|
|
217
|
-
canTake(): boolean;
|
|
218
|
-
take(): boolean;
|
|
219
|
-
timeUntilReset(): number;
|
|
220
|
-
responseReceived(): void;
|
|
221
|
-
applyCount(limit: number | null, remaining: number, resetAfter: number): void;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* @since 0.17.0
|
|
225
|
-
*/
|
|
226
|
-
declare class LeakyCounter implements Counter {
|
|
227
|
-
limit: number;
|
|
228
|
-
/**
|
|
229
|
-
* Remaining amount of executions during the current timeframe
|
|
230
|
-
*/
|
|
231
|
-
remaining: number;
|
|
232
|
-
private resetAt;
|
|
233
|
-
readonly id: string;
|
|
234
|
-
/**
|
|
235
|
-
* Create a new base bucket
|
|
236
|
-
* @param limit Number of functions that may be executed until some are reset
|
|
237
|
-
*/
|
|
238
|
-
constructor(limit: number);
|
|
239
|
-
private checkReset;
|
|
240
|
-
hasReset(): boolean;
|
|
241
|
-
canTake(): boolean;
|
|
242
|
-
take(): boolean;
|
|
243
|
-
timeUntilReset(): number;
|
|
244
|
-
responseReceived(): void;
|
|
245
|
-
applyCount(limit: number | null, remaining: number, resetAfter: number): void;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Bucket used for saving ratelimits
|
|
249
|
-
* @since 0.1.0
|
|
250
|
-
*/
|
|
251
|
-
declare class Bucket {
|
|
252
|
-
/** Tracks the state this bucket is in (blocked, running, waiting, etc) and what operations are allowed. */
|
|
253
|
-
readonly sm: StateMachine;
|
|
254
|
-
/** Wrapped functions which always resolve (not reject) after the original function has completed and resolved. The original function may manipulate rate limit buckets in that time before it resolves. */
|
|
255
|
-
readonly calls: Array<() => any>;
|
|
256
|
-
/** The backing counters of the bucket that determine how many functions can be consumed in a timeframe. */
|
|
257
|
-
readonly counters: Array<Counter>;
|
|
258
|
-
private pauseRequested;
|
|
259
|
-
/**
|
|
260
|
-
* Create a new bucket
|
|
261
|
-
*/
|
|
262
|
-
constructor(counters: Array<Counter>);
|
|
263
|
-
/**
|
|
264
|
-
* Queue a function to be executed
|
|
265
|
-
* @since 0.12.0
|
|
266
|
-
* @param fn function to be executed
|
|
267
|
-
* @returns Result of the function if any
|
|
268
|
-
*/
|
|
269
|
-
enqueue<T>(fn: (bkt: this) => Promise<T>): Promise<T>;
|
|
270
|
-
/**
|
|
271
|
-
* Pause the bucket from consuming more functions until resumed
|
|
272
|
-
* @since 0.16.0
|
|
273
|
-
*/
|
|
274
|
-
pause(): void;
|
|
275
|
-
/**
|
|
276
|
-
* If the bucket is paused, resume it
|
|
277
|
-
* @since 0.16.0
|
|
278
|
-
*/
|
|
279
|
-
resume(): void;
|
|
280
|
-
/**
|
|
281
|
-
* Clear the current queue of events to be sent
|
|
282
|
-
* @since 0.1.0
|
|
283
|
-
*/
|
|
284
|
-
dropQueue(): void;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Ratelimiter used for handling the ratelimits imposed by the rest api
|
|
288
|
-
* @since 0.1.0
|
|
289
|
-
* @protected
|
|
290
|
-
*/
|
|
291
|
-
declare class Ratelimiter {
|
|
292
|
-
/**
|
|
293
|
-
* A Map of Buckets keyed by route keys that store rate limit info
|
|
294
|
-
*/
|
|
295
|
-
readonly buckets: Map<string, Bucket>;
|
|
296
|
-
/**
|
|
297
|
-
* The bucket that limits how many requests per second you can make globally
|
|
298
|
-
*/
|
|
299
|
-
readonly globalBucket: Bucket;
|
|
300
|
-
/**
|
|
301
|
-
* If you're being globally rate limited
|
|
302
|
-
*/
|
|
303
|
-
get global(): boolean;
|
|
304
|
-
constructor();
|
|
305
|
-
/**
|
|
306
|
-
* Returns a key for saving ratelimits for routes
|
|
307
|
-
* (Taken from https://github.com/abalabahaha/eris/blob/master/lib/rest/RequestHandler.js) -> I luv u abal <3
|
|
308
|
-
* @since 0.1.0
|
|
309
|
-
* @param url url to reduce to a key something like /channels/266277541646434305/messages/266277541646434305/
|
|
310
|
-
* @param method method of the request, usual http methods like get, etc.
|
|
311
|
-
* @returns reduced url: /channels/266277541646434305/messages/:id/
|
|
312
|
-
*/
|
|
313
|
-
routify(url: string, method: string): string;
|
|
314
|
-
/**
|
|
315
|
-
* Choose a bucket from the route and enqueue a rest call in it
|
|
316
|
-
* @since 0.1.0
|
|
317
|
-
* @param fn function to call once the ratelimit is ready
|
|
318
|
-
* @param url Endpoint of the request
|
|
319
|
-
* @param method Http method used by the request
|
|
320
|
-
*/
|
|
321
|
-
queue<T>(fn: (bucket: Bucket) => Promise<T>, url: string, method: string): Promise<T>;
|
|
322
|
-
/**
|
|
323
|
-
* Set if this Ratelimiter is hitting a global ratelimit for `ms` duration
|
|
324
|
-
* @since 0.12.0
|
|
325
|
-
* @param ms How long in milliseconds this Ratelimiter is globally ratelimited for
|
|
326
|
-
*/
|
|
327
|
-
setGlobal(ms: number): void;
|
|
328
|
-
}
|
|
329
|
-
declare namespace RequestHandler {
|
|
330
|
-
type Options = {
|
|
331
|
-
/** The base URL to use when making requests. Defaults to https://discord.com */
|
|
332
|
-
baseHost: string;
|
|
333
|
-
/** The base path of the base URL to use for the API. Defaults to /api/v${Constants.REST_API_VERSION} */
|
|
334
|
-
baseURL: string;
|
|
335
|
-
/** If rate limit buckets should be ignored */
|
|
336
|
-
bypassBuckets: boolean;
|
|
337
|
-
/** If failed requests that can be retried should be retried, up to retryLimit times. */
|
|
338
|
-
retryFailed: boolean;
|
|
339
|
-
/** How many times requests should be retried if they fail and can be retried. */
|
|
340
|
-
retryLimit: number;
|
|
341
|
-
headers: {
|
|
342
|
-
Authorization?: string;
|
|
343
|
-
"User-Agent": string;
|
|
344
|
-
};
|
|
345
|
-
fetch: typeof fetch;
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Request Handler class
|
|
350
|
-
* @since 0.1.0
|
|
351
|
-
* @protected
|
|
352
|
-
*/
|
|
353
|
-
declare class RequestHandler extends EventEmitter$1<HandlerEvents> {
|
|
354
|
-
ratelimiter: Ratelimiter;
|
|
355
|
-
options: RequestHandler.Options;
|
|
356
|
-
latency: number;
|
|
357
|
-
apiURL: string;
|
|
358
|
-
/**
|
|
359
|
-
* Create a new request handler
|
|
360
|
-
* @param ratelimiter ratelimiter to use for ratelimiting requests
|
|
361
|
-
* @param options options
|
|
362
|
-
*/
|
|
363
|
-
constructor(ratelimiter: Ratelimiter, options?: {
|
|
364
|
-
token?: string;
|
|
365
|
-
} & Partial<Omit<RequestHandler.Options, "headers">>);
|
|
366
|
-
/**
|
|
367
|
-
* Request a route from the discord api
|
|
368
|
-
* @since 0.1.0
|
|
369
|
-
* @param endpoint endpoint to request
|
|
370
|
-
* @param params URL query parameters to add on to the URL
|
|
371
|
-
* @param method http method to use
|
|
372
|
-
* @param dataType type of the data being sent
|
|
373
|
-
* @param data data to send, if any
|
|
374
|
-
* @param extraHeaders Any headers to send on top of the existing ones for this request
|
|
375
|
-
* @param retries How many retries should be performed for this request if it fails when possible and not a bad status code is returned
|
|
376
|
-
* @param rawResponse If the raw Response Object from fetch should be returned instead of trying to return a response.json() or undefined if no body
|
|
377
|
-
* @returns Result of the request
|
|
378
|
-
*/
|
|
379
|
-
request(endpoint: string, params: Record<string, any> | undefined, method: HTTPMethod, dataType: "json", data?: any, extraHeaders?: Record<string, string>, retries?: number, rawResponse?: boolean): Promise<any>;
|
|
380
|
-
request(endpoint: string, params: Record<string, any> | undefined, method: HTTPMethod, dataType: "multipart", data?: FormData, extraHeaders?: Record<string, string>, retries?: number, rawResponse?: boolean): Promise<any>;
|
|
381
|
-
request(endpoint: string, params: Record<string, any> | undefined, method: HTTPMethod, dataType: "json" | "multipart", data?: any, extraHeaders?: Record<string, string>, retries?: number, rawResponse?: true): Promise<Response>;
|
|
382
|
-
/**
|
|
383
|
-
* Apply the received ratelimit headers to the ratelimit bucket
|
|
384
|
-
* @since 0.1.0
|
|
385
|
-
* @param bkt Ratelimit bucket to apply the headers to
|
|
386
|
-
* @param headers Http headers received from discord
|
|
387
|
-
*/
|
|
388
|
-
private _applyRatelimitHeaders;
|
|
389
|
-
/**
|
|
390
|
-
* Execute a normal json request
|
|
391
|
-
* @since 0.1.0
|
|
392
|
-
* @param endpoint Endpoint to use
|
|
393
|
-
* @param params URL query parameters to add on to the URL
|
|
394
|
-
* @param data Data to send
|
|
395
|
-
* @returns Result of the request
|
|
396
|
-
*/
|
|
397
|
-
private _request;
|
|
398
|
-
/**
|
|
399
|
-
* Execute a multipart/form-data request
|
|
400
|
-
* @since 0.1.0
|
|
401
|
-
* @param endpoint Endpoint to use
|
|
402
|
-
* @param params URL query parameters to add on to the URL
|
|
403
|
-
* @param method Http Method to use
|
|
404
|
-
* @param data data to send
|
|
405
|
-
* @returns Result of the request
|
|
406
|
-
*/
|
|
407
|
-
private _multiPartRequest;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* Methods for interacting with Guild Audit Logs
|
|
412
|
-
* @since 0.2.0
|
|
413
|
-
* @protected
|
|
414
|
-
*/
|
|
415
|
-
declare class AuditLogMethods {
|
|
416
|
-
readonly requestHandler: RequestHandler;
|
|
417
|
-
/**
|
|
418
|
-
* Create a new Audit Log Method Handler
|
|
419
|
-
*
|
|
420
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
421
|
-
*
|
|
422
|
-
* You can access the methods listed via `client.auditLog.method`, where `client` is an initialized SnowTransfer instance
|
|
423
|
-
* @param requestHandler request handler that calls the rest api
|
|
424
|
-
*/
|
|
425
|
-
constructor(requestHandler: RequestHandler);
|
|
426
|
-
/**
|
|
427
|
-
* Get the audit logs of the specified guild id
|
|
428
|
-
* @since 0.2.0
|
|
429
|
-
* @param guildId id of a guild
|
|
430
|
-
* @param options optional audit log filter values
|
|
431
|
-
* @returns An object with [audit log data](https://discord.com/developers/docs/resources/audit-log#audit-log-object)
|
|
432
|
-
*
|
|
433
|
-
* | Permissions needed | Condition |
|
|
434
|
-
* |--------------------|-----------|
|
|
435
|
-
* | VIEW_AUDIT_LOG | always |
|
|
436
|
-
*
|
|
437
|
-
* @example
|
|
438
|
-
* // Get an audit log entry of user 12345678901234567 updating themself (24 is MEMBER_UPDATE)
|
|
439
|
-
* const client = new SnowTransfer("TOKEN")
|
|
440
|
-
* const data = {
|
|
441
|
-
* user_id: "12345678901234567",
|
|
442
|
-
* action_type: 24,
|
|
443
|
-
* }
|
|
444
|
-
* const channel = await client.auditLog.getAuditLog("guild id", data)
|
|
445
|
-
*/
|
|
446
|
-
getAuditLog(guildId: string, options?: RESTGetAPIAuditLogQuery): Promise<RESTGetAPIAuditLogResult>;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Methods for interacting with guild auto moderation
|
|
451
|
-
* @since 0.7.0
|
|
452
|
-
* @protected
|
|
453
|
-
*/
|
|
454
|
-
declare class AutoModerationMethods {
|
|
455
|
-
readonly requestHandler: RequestHandler;
|
|
456
|
-
/**
|
|
457
|
-
* Create a new Auto Moderation Method Handler
|
|
458
|
-
*
|
|
459
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
460
|
-
*
|
|
461
|
-
* You can access the methods listed via `client.autoMod.method`, where `client` is an initialized SnowTransfer instance
|
|
462
|
-
* @param requestHandler request handler that calls the rest api
|
|
463
|
-
*/
|
|
464
|
-
constructor(requestHandler: RequestHandler);
|
|
465
|
-
/**
|
|
466
|
-
* Get all of the auto moderation rules from a guild
|
|
467
|
-
* @since 0.7.0
|
|
468
|
-
* @param guildId id of the guild
|
|
469
|
-
* @returns A list of [auto mod rules](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object)
|
|
470
|
-
*
|
|
471
|
-
* | Permissions needed | Condition |
|
|
472
|
-
* |--------------------|-----------|
|
|
473
|
-
* | MANAGE_GUILD | always |
|
|
474
|
-
*
|
|
475
|
-
* @example
|
|
476
|
-
* // gets all automod rules of a guild
|
|
477
|
-
* const client = new SnowTransfer("TOKEN")
|
|
478
|
-
* const rules = await client.autoMod.getAutoModerationRules("guild id")
|
|
479
|
-
*/
|
|
480
|
-
getAutoModerationRules(guildId: string): Promise<RESTGetAPIAutoModerationRulesResult>;
|
|
481
|
-
/**
|
|
482
|
-
* Get a auto moderation rules from a guild
|
|
483
|
-
* @since 0.7.0
|
|
484
|
-
* @param guildId id of the guild
|
|
485
|
-
* @param ruleId id of the rule
|
|
486
|
-
* @returns An [auto mod rule](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object)
|
|
487
|
-
*
|
|
488
|
-
* | Permissions needed | Condition |
|
|
489
|
-
* |--------------------|-----------|
|
|
490
|
-
* | MANAGE_GUILD | always |
|
|
491
|
-
*
|
|
492
|
-
* @example
|
|
493
|
-
* // gets an automod rule from a guild
|
|
494
|
-
* const client = new SnowTransfer("TOKEN")
|
|
495
|
-
* const rule = await client.autoMod.getAutoModerationRule("guild id", "rule id")
|
|
496
|
-
*/
|
|
497
|
-
getAutoModerationRule(guildId: string, ruleId: string): Promise<RESTGetAPIAutoModerationRuleResult>;
|
|
498
|
-
/**
|
|
499
|
-
* Create an auto moderation rule for a guild
|
|
500
|
-
* @since 0.7.0
|
|
501
|
-
* @param guildId id of the guild
|
|
502
|
-
* @param data the data of the auto moderation rule
|
|
503
|
-
* @param reason Reason for creating the auto moderation rule
|
|
504
|
-
* @returns An [auto mod rule](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object)
|
|
505
|
-
*
|
|
506
|
-
* | Permissions needed | Condition |
|
|
507
|
-
* |--------------------|-----------|
|
|
508
|
-
* | MANAGE_GUILD | always |
|
|
509
|
-
*
|
|
510
|
-
* @example
|
|
511
|
-
* const client = new SnowTransfer("TOKEN")
|
|
512
|
-
* const data = {
|
|
513
|
-
* name: "mention_spam_prevent",
|
|
514
|
-
* event_type: 1,
|
|
515
|
-
* trigger_type: 5,
|
|
516
|
-
* trigger_metadata: {
|
|
517
|
-
* mention_total_limit: 6
|
|
518
|
-
* },
|
|
519
|
-
* actions: [
|
|
520
|
-
* {
|
|
521
|
-
* type: 1
|
|
522
|
-
* }
|
|
523
|
-
* ]
|
|
524
|
-
* }
|
|
525
|
-
* const newRule = await client.autoMod.createAutoModerationRule("guild id", data)
|
|
526
|
-
*/
|
|
527
|
-
createAutoModerationRule(guildId: string, data: RESTPostAPIAutoModerationRuleJSONBody, reason?: string): Promise<RESTPostAPIAutoModerationRuleResult>;
|
|
528
|
-
/**
|
|
529
|
-
* Edit an auto moderation rule for a guild
|
|
530
|
-
* @since 0.7.0
|
|
531
|
-
* @param guildId id of the guild
|
|
532
|
-
* @param ruleId id of the rule
|
|
533
|
-
* @param data the data of the auto moderation rule
|
|
534
|
-
* @param reason Reason for editing the auto moderation rule
|
|
535
|
-
* @returns An [auto mod rule](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object)
|
|
536
|
-
*
|
|
537
|
-
* | Permissions needed | Condition |
|
|
538
|
-
* |--------------------|-----------|
|
|
539
|
-
* | MANAGE_GUILD | always |
|
|
540
|
-
*
|
|
541
|
-
* @example
|
|
542
|
-
* // Turn on the rule I forgot was disabled by default
|
|
543
|
-
* const client = new SnowTransfer("TOKEN")
|
|
544
|
-
* const data = {
|
|
545
|
-
* name: "mention_spam_prevention",
|
|
546
|
-
* enabled: true,
|
|
547
|
-
* }
|
|
548
|
-
* const updatedRule = await client.autoMod.editAutoModerationRule("guild id", "rule id", data, "It's turned off by default and I forgor")
|
|
549
|
-
*/
|
|
550
|
-
editAutoModerationRule(guildId: string, ruleId: string, data: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string): Promise<RESTPatchAPIAutoModerationRuleResult>;
|
|
551
|
-
/**
|
|
552
|
-
* Deletes an auto moderation rule for a guild
|
|
553
|
-
* @since 0.7.0
|
|
554
|
-
* @param guildId id of the guild
|
|
555
|
-
* @param ruleId id of the rule
|
|
556
|
-
* @param reason Reason for deleting the rule
|
|
557
|
-
* @returns Resolves the Promise on successful execution
|
|
558
|
-
*
|
|
559
|
-
* | Permissions needed | Condition |
|
|
560
|
-
* |--------------------|-----------|
|
|
561
|
-
* | MANAGE_GUILD | always |
|
|
562
|
-
*
|
|
563
|
-
* @example
|
|
564
|
-
* const client = new SnowTransfer("TOKEN")
|
|
565
|
-
* client.autoMod.deleteAutoModerationRules("guild id", "rule id", "was useless")
|
|
566
|
-
*/
|
|
567
|
-
deleteAutoModerationRule(guildId: string, ruleId: string, reason?: string): Promise<void>;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
/**
|
|
571
|
-
* Methods for interacting with bot specific endpoints
|
|
572
|
-
* @since 0.1.0
|
|
573
|
-
* @protected
|
|
574
|
-
*/
|
|
575
|
-
declare class BotMethods {
|
|
576
|
-
readonly requestHandler: RequestHandler;
|
|
577
|
-
/**
|
|
578
|
-
* Create a new Bot Method Handler
|
|
579
|
-
*
|
|
580
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
581
|
-
*
|
|
582
|
-
* You can access the methods listed via `client.bot.method`, where `client` is an initialized SnowTransfer instance
|
|
583
|
-
* @param requestHandler request handler that calls the rest api
|
|
584
|
-
*/
|
|
585
|
-
constructor(requestHandler: RequestHandler);
|
|
586
|
-
/**
|
|
587
|
-
* Get the gateway url to connect to
|
|
588
|
-
* @since 0.1.0
|
|
589
|
-
* @returns [Gateway data](https://discord.com/developers/docs/topics/gateway#get-gateway-example-response)
|
|
590
|
-
*
|
|
591
|
-
* @example
|
|
592
|
-
* const client = new SnowTransfer("TOKEN")
|
|
593
|
-
* const result = await client.bot.getGateway()
|
|
594
|
-
* // result should be something like { url: "wss://gateway.discord.gg" }
|
|
595
|
-
*/
|
|
596
|
-
getGateway(): Promise<RESTGetAPIGatewayResult>;
|
|
597
|
-
/**
|
|
598
|
-
* Get the gateway url to connect to and a recommended amount of shards to use
|
|
599
|
-
* @since 0.1.0
|
|
600
|
-
* @returns [Gateway data](https://discord.com/developers/docs/topics/gateway#get-gateway-example-response)
|
|
601
|
-
*
|
|
602
|
-
* @example
|
|
603
|
-
* const client = new SnowTransfer("TOKEN")
|
|
604
|
-
* const result = await client.bot.getGatewayBot()
|
|
605
|
-
* // result should be something like { url: "wss://gateway.discord.gg", shards: 1, session_start_limit: { total: 1000, remaining: 999, reset_after: 14400000, max_concurrency: 1 } }
|
|
606
|
-
*/
|
|
607
|
-
getGatewayBot(): Promise<RESTGetAPIGatewayBotResult>;
|
|
608
|
-
/**
|
|
609
|
-
* Get the Application Object for the Current User
|
|
610
|
-
* @since 0.11.0
|
|
611
|
-
* @returns An [Application object](https://discord.com/developers/docs/resources/application#application-object-application-structure)
|
|
612
|
-
*
|
|
613
|
-
* @example
|
|
614
|
-
* const client = new SnowTransfer("TOKEN")
|
|
615
|
-
* const result = await client.bot.getApplicationInfo()
|
|
616
|
-
*/
|
|
617
|
-
getApplicationInfo(): Promise<APIApplication>;
|
|
618
|
-
/**
|
|
619
|
-
* Update the Application Object for the Current User
|
|
620
|
-
* @since 0.13.0
|
|
621
|
-
* @returns An [Application object](https://discord.com/developers/docs/resources/application#application-object-application-structure)
|
|
622
|
-
*
|
|
623
|
-
* @example
|
|
624
|
-
* const client = new SnowTransfer("TOKEN")
|
|
625
|
-
* const appData = {
|
|
626
|
-
* description: "My new bot description",
|
|
627
|
-
* interactions_endpoint_url: "https://mycoolbot.example/api/interactions"
|
|
628
|
-
* };
|
|
629
|
-
* client.bot.updateApplicationInfo(appData)
|
|
630
|
-
*/
|
|
631
|
-
updateApplicationInfo(data: RESTPatchCurrentApplicationJSONBody): Promise<APIApplication>;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Methods for interacting with assets like emojis and stickers for a guild/app
|
|
636
|
-
* @since 0.13.0
|
|
637
|
-
* @protected
|
|
638
|
-
*/
|
|
639
|
-
declare class AssetsMethods {
|
|
640
|
-
readonly requestHandler: RequestHandler;
|
|
641
|
-
/**
|
|
642
|
-
* Create a new Assets Method handler
|
|
643
|
-
*
|
|
644
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
645
|
-
*
|
|
646
|
-
* You can access the methods listed via `client.assets.method`, where `client` is an initialized SnowTransfer instance
|
|
647
|
-
* @param requestHandler request handler that calls the rest api
|
|
648
|
-
*/
|
|
649
|
-
constructor(requestHandler: RequestHandler);
|
|
650
|
-
/**
|
|
651
|
-
* Get a list of emojis of a guild
|
|
652
|
-
* @since 0.13.0
|
|
653
|
-
* @param guildId Id of the guild
|
|
654
|
-
* @returns Array of [emoji objects](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
655
|
-
*
|
|
656
|
-
* @example
|
|
657
|
-
* const client = new SnowTransfer("TOKEN")
|
|
658
|
-
* const emojis = await client.assets.getGuildEmojis("guild id")
|
|
659
|
-
*/
|
|
660
|
-
getGuildEmojis(guildId: string): Promise<RESTGetAPIGuildEmojisResult>;
|
|
661
|
-
/**
|
|
662
|
-
* Get an emoji from a guild via id
|
|
663
|
-
* @since 0.13.0
|
|
664
|
-
* @param guildId Id of the guild
|
|
665
|
-
* @param emojiId Id of the emoji
|
|
666
|
-
* @returns [Emoji object](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
667
|
-
*
|
|
668
|
-
* @example
|
|
669
|
-
* const client = new SnowTransfer("TOKEN")
|
|
670
|
-
* const emoji = await client.assets.getGuildEmoji("guild id", "emoji id")
|
|
671
|
-
*/
|
|
672
|
-
getGuildEmoji(guildId: string, emojiId: string): Promise<RESTGetAPIGuildEmojiResult>;
|
|
673
|
-
/**
|
|
674
|
-
* Create a new Emoji in a guild
|
|
675
|
-
* @since 0.13.0
|
|
676
|
-
* @param guildId Id of the guild
|
|
677
|
-
* @param data Emoji data, check the example
|
|
678
|
-
* @param reason Reason for creating the emoji
|
|
679
|
-
* @returns [Emoji object](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
680
|
-
*
|
|
681
|
-
* | Permissions needed | Condition |
|
|
682
|
-
* |----------------------------|-----------|
|
|
683
|
-
* | MANAGE_EMOJIS_AND_STICKERS | always |
|
|
684
|
-
*
|
|
685
|
-
* @example
|
|
686
|
-
* // upload a simple png emoji with a name of "niceEmoji"
|
|
687
|
-
* const client = new SnowTransfer("TOKEN")
|
|
688
|
-
* const fileData = fs.readFileSync("nice_emoji.png") // You should probably use fs.promises.readFile, since it is asynchronous, synchronous methods pause the thread.
|
|
689
|
-
* const emojiData = \{
|
|
690
|
-
* name: "niceEmoji",
|
|
691
|
-
* image: `data:image/png;base64,${fileData.toString("base64")}` // base64 data url: data:mimetype;base64,base64String
|
|
692
|
-
* \}
|
|
693
|
-
* client.assets.createGuildEmoji("guild id", emojiData)
|
|
694
|
-
*/
|
|
695
|
-
createGuildEmoji(guildId: string, data: RESTPostAPIGuildEmojiJSONBody, reason?: string): Promise<RESTPostAPIGuildEmojiResult>;
|
|
696
|
-
/**
|
|
697
|
-
* Update an existing emoji from a guild
|
|
698
|
-
* @since 0.13.0
|
|
699
|
-
* @param guildId Id of the guild
|
|
700
|
-
* @param emojiId Id of the emoji
|
|
701
|
-
* @param data Emoji data
|
|
702
|
-
* @param reason Reason for updating the emoji
|
|
703
|
-
* @returns [Emoji object](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
704
|
-
*
|
|
705
|
-
* | Permissions needed | Condition |
|
|
706
|
-
* |----------------------------|-----------|
|
|
707
|
-
* | MANAGE_EMOJIS_AND_STICKERS | always |
|
|
708
|
-
*
|
|
709
|
-
* @example
|
|
710
|
-
* // Change the name of an existing emoji to "niceEmote"
|
|
711
|
-
* const client = new SnowTransfer("TOKEN")
|
|
712
|
-
* const emojiData = {
|
|
713
|
-
* name: "niceEmote"
|
|
714
|
-
* }
|
|
715
|
-
* client.assets.updateGuildEmoji("guild id", "emoji id", emojiData)
|
|
716
|
-
*/
|
|
717
|
-
updateGuildEmoji(guildId: string, emojiId: string, data: RESTPatchAPIGuildEmojiJSONBody, reason?: string): Promise<RESTPatchAPIGuildEmojiResult>;
|
|
718
|
-
/**
|
|
719
|
-
* Delete an emoji from a guild
|
|
720
|
-
* @since 0.13.0
|
|
721
|
-
* @param guildId Id of the guild
|
|
722
|
-
* @param emojiId Id of the emoji
|
|
723
|
-
* @param reason Reason for deleting the emoji
|
|
724
|
-
* @returns Resolves the Promise on successful execution
|
|
725
|
-
*
|
|
726
|
-
* | Permissions needed | Condition |
|
|
727
|
-
* |----------------------------|-----------|
|
|
728
|
-
* | MANAGE_EMOJIS_AND_STICKERS | always |
|
|
729
|
-
*
|
|
730
|
-
* @example
|
|
731
|
-
* // Deletes an emoji because it wasn't nice
|
|
732
|
-
* const client = new SnowTransfer("TOKEN")
|
|
733
|
-
* client.assets.deleteGuildEmoji("guild id", "emoji id", "wasn't nice")
|
|
734
|
-
*/
|
|
735
|
-
deleteGuildEmoji(guildId: string, emojiId: string, reason?: string): Promise<void>;
|
|
736
|
-
/**
|
|
737
|
-
* Get a global sticker
|
|
738
|
-
* @since 0.13.0
|
|
739
|
-
* @param stickerId Id of the sticker
|
|
740
|
-
* @returns [Sticker object](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
741
|
-
*
|
|
742
|
-
* @example
|
|
743
|
-
* const client = new SnowTransfer("TOKEN")
|
|
744
|
-
* const sticker = await client.assets.getSticker("sticker id")
|
|
745
|
-
*/
|
|
746
|
-
getSticker(stickerId: string): Promise<RESTGetAPIStickerResult>;
|
|
747
|
-
/**
|
|
748
|
-
* Get all guild stickers
|
|
749
|
-
* @since 0.13.0
|
|
750
|
-
* @param guildId Id of the guild
|
|
751
|
-
* @returns An Array of [sticker objects](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
752
|
-
*
|
|
753
|
-
* | Permissions needed | Condition |
|
|
754
|
-
* |----------------------------|---------------------------------------------|
|
|
755
|
-
* | MANAGE_EMOJIS_AND_STICKERS | if the CurrentUser desires the `user` field |
|
|
756
|
-
*
|
|
757
|
-
* @example
|
|
758
|
-
* const client = new SnowTransfer("TOKEN")
|
|
759
|
-
* const stickers = await client.assets.getGuildStickers("guild id")
|
|
760
|
-
*/
|
|
761
|
-
getGuildStickers(guildId: string): Promise<RESTGetAPIGuildStickersResult>;
|
|
762
|
-
/**
|
|
763
|
-
* Get a guild sticker
|
|
764
|
-
* @since 0.13.0
|
|
765
|
-
* @param guildId Id of the guild
|
|
766
|
-
* @param stickerId Id of the sticker
|
|
767
|
-
* @returns A [sticker object](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
768
|
-
*
|
|
769
|
-
* | Permissions needed | Condition |
|
|
770
|
-
* |----------------------------|---------------------------------------------|
|
|
771
|
-
* | MANAGE_EMOJIS_AND_STICKERS | if the CurrentUser desires the `user` field |
|
|
772
|
-
*
|
|
773
|
-
* @example
|
|
774
|
-
* const client = new SnowTransfer("TOKEN")
|
|
775
|
-
* const sticker = await client.assets.getGuildSticker("guild id", "sticker id")
|
|
776
|
-
*/
|
|
777
|
-
getGuildSticker(guildId: string, stickerId: string): Promise<RESTGetAPIGuildStickerResult>;
|
|
778
|
-
/**
|
|
779
|
-
* Create a guild sticker
|
|
780
|
-
* @since 0.13.0
|
|
781
|
-
* @param guildId Id of the guild
|
|
782
|
-
* @param data Sticker data
|
|
783
|
-
* @param reason Reason for creating the sticker
|
|
784
|
-
* @returns A [sticker object](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
785
|
-
*
|
|
786
|
-
* | Permissions needed | Condition |
|
|
787
|
-
* |-----------------------------|-------------------------------------------------|
|
|
788
|
-
* | MANAGE_EMOJIS_AND_STICKERS | always |
|
|
789
|
-
*
|
|
790
|
-
* | Guild Features needed | Condition |
|
|
791
|
-
* |-----------------------|-------------------------------------------------|
|
|
792
|
-
* | VERIFIED or PARTNERED | If CurrentUser tries to create a LOTTIE sticker |
|
|
793
|
-
*
|
|
794
|
-
* @example
|
|
795
|
-
* // Creates a LOTTIE sticker
|
|
796
|
-
* const client = new SnowTransfer("TOKEN")
|
|
797
|
-
* const fileData = fs.readFileSync("nice_sticker.json") // You should probably use fs.promises.readFile, since it is asynchronous, synchronous methods pause the thread.
|
|
798
|
-
* const stickerData = {
|
|
799
|
-
* name: "niceSticker",
|
|
800
|
-
* file: fileData,
|
|
801
|
-
* description: "A very nice sticker",
|
|
802
|
-
* tags: ["nice", "sticker"],
|
|
803
|
-
* }
|
|
804
|
-
* const sticker = await client.assets.createGuildSticker("guild id", stickerData)
|
|
805
|
-
*/
|
|
806
|
-
createGuildSticker(guildId: string, data: RESTPostAPIGuildStickerFormDataBody & {
|
|
807
|
-
file: Buffer | Blob | File | Readable | ReadableStream;
|
|
808
|
-
}, reason?: string): Promise<RESTPostAPIGuildStickerResult>;
|
|
809
|
-
/**
|
|
810
|
-
* Update a guild sticker
|
|
811
|
-
* @since 0.13.0
|
|
812
|
-
* @param guildId Id of the guild
|
|
813
|
-
* @param stickerId Id of the sticker
|
|
814
|
-
* @param data Sticker data
|
|
815
|
-
* @param reason Reason for updating the sticker
|
|
816
|
-
* @returns A [sticker object](https://discord.com/developers/docs/resources/sticker#sticker-object)
|
|
817
|
-
*
|
|
818
|
-
* | Permissions needed | Condition |
|
|
819
|
-
* |----------------------------|-----------|
|
|
820
|
-
* | MANAGE_EMOJIS_AND_STICKERS | always |
|
|
821
|
-
*
|
|
822
|
-
* @example
|
|
823
|
-
* // Updates a sticker's name to "nicerSticker"
|
|
824
|
-
* const client = new SnowTransfer("TOKEN")
|
|
825
|
-
* const sticker = await client.assets.updateGuildSticker("guild id", "sticker id", { name: "nicerSticker" }, "because it was nicer")
|
|
826
|
-
*/
|
|
827
|
-
updateGuildSticker(guildId: string, stickerId: string, data: RESTPatchAPIGuildStickerJSONBody, reason?: string): Promise<RESTPatchAPIGuildStickerResult>;
|
|
828
|
-
/**
|
|
829
|
-
* Delete a guild sticker
|
|
830
|
-
* @since 0.13.0
|
|
831
|
-
* @param guildId Id of the guild
|
|
832
|
-
* @param stickerId Id of the sticker
|
|
833
|
-
* @param reason Reason for deleting the sticker
|
|
834
|
-
* @returns Resolves the Promise on successful execution
|
|
835
|
-
*
|
|
836
|
-
* | Permissions needed | Condition |
|
|
837
|
-
* |----------------------------|-----------|
|
|
838
|
-
* | MANAGE_EMOJIS_AND_STICKERS | always |
|
|
839
|
-
*
|
|
840
|
-
* @example
|
|
841
|
-
* // Deletes a sticker because it was too nice
|
|
842
|
-
* const client = new SnowTransfer("TOKEN")
|
|
843
|
-
* client.assets.deleteGuildSticker("guild id", "sticker id", "It was too nice")
|
|
844
|
-
*/
|
|
845
|
-
deleteGuildSticker(guildId: string, stickerId: string, reason?: string): Promise<void>;
|
|
846
|
-
/**
|
|
847
|
-
* Get all emojis for an app
|
|
848
|
-
* @since 0.13.0
|
|
849
|
-
* @param appId Id of the app
|
|
850
|
-
* @returns An Array of [emoji objects](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
851
|
-
*
|
|
852
|
-
* @example
|
|
853
|
-
* // Gets all emojis for an app
|
|
854
|
-
* const client = new SnowTransfer("TOKEN")
|
|
855
|
-
* const emojis = await client.assets.getAppEmojis("app id")
|
|
856
|
-
*/
|
|
857
|
-
getAppEmojis(appId: string): Promise<RESTGetAPIApplicationEmojisResult>;
|
|
858
|
-
/**
|
|
859
|
-
* Get an emoji for an app by id
|
|
860
|
-
* @since 0.13.0
|
|
861
|
-
* @param appId Id of the app
|
|
862
|
-
* @param emojiId Id of the emoji
|
|
863
|
-
* @returns [emoji object](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
864
|
-
*
|
|
865
|
-
* @example
|
|
866
|
-
* // Gets an emoji by id from an app
|
|
867
|
-
* const client = new SnowTransfer("TOKEN")
|
|
868
|
-
* const emoji = await client.assets.getAppEmoji("app id", "emoji id")
|
|
869
|
-
*/
|
|
870
|
-
getAppEmoji(appId: string, emojiId: string): Promise<RESTGetAPIApplicationEmojiResult>;
|
|
871
|
-
/**
|
|
872
|
-
* Create an emoji for an app
|
|
873
|
-
* @since 0.13.0
|
|
874
|
-
* @param appId Id of the app
|
|
875
|
-
* @param data Emoji data, check the example
|
|
876
|
-
* @returns [emoji object](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
877
|
-
*
|
|
878
|
-
* @example
|
|
879
|
-
* // Creates an emoji for an app with a NICER name
|
|
880
|
-
* const client = new SnowTransfer("TOKEN")
|
|
881
|
-
* const fileData = fs.readFileSync("even_nicer_emoji.png") // You should probably use fs.promises.readFile, since it is asynchronous, synchronous methods pause the thread.
|
|
882
|
-
* const emojiData = \{
|
|
883
|
-
* name: "nicerEmoji",
|
|
884
|
-
* image: `data:image/png;base64,${fileData.toString("base64")}` // base64 data url: data:mimetype;base64,base64String
|
|
885
|
-
* \}
|
|
886
|
-
* client.assets.createAppEmoji("app id", emojiData)
|
|
887
|
-
*/
|
|
888
|
-
createAppEmoji(appId: string, data: RESTPostAPIApplicationEmojiJSONBody): Promise<RESTPostAPIApplicationEmojiResult>;
|
|
889
|
-
/**
|
|
890
|
-
* Updates an emoji for an app
|
|
891
|
-
* @since 0.13.0
|
|
892
|
-
* @param appId Id of the app
|
|
893
|
-
* @param emojiId Id of the emoji
|
|
894
|
-
* @param data Emoji data
|
|
895
|
-
* @returns [emoji object](https://discord.com/developers/docs/resources/emoji#emoji-object)
|
|
896
|
-
*
|
|
897
|
-
* @example
|
|
898
|
-
* // The emoji we just made is actually the nicest emoji ever. Gotta reflect that
|
|
899
|
-
* const client = new SnowTransfer("TOKEN")
|
|
900
|
-
* const emojiData = {
|
|
901
|
-
* name: "nicestEmoji"
|
|
902
|
-
* }
|
|
903
|
-
* client.assets.updateAppEmoji("app id", "emoji id", emojiData)
|
|
904
|
-
*/
|
|
905
|
-
updateAppEmoji(appId: string, emojiId: string, data: RESTPatchAPIApplicationEmojiJSONBody): Promise<RESTPatchAPIApplicationEmojiResult>;
|
|
906
|
-
/**
|
|
907
|
-
* Delete an emoji for an app
|
|
908
|
-
* @since 0.13.0
|
|
909
|
-
* @param appId Id of the app
|
|
910
|
-
* @param emojiId Id of the emoji
|
|
911
|
-
* @returns Resolves the Promise on successful execution
|
|
912
|
-
*
|
|
913
|
-
* @example
|
|
914
|
-
* // The emoji was TOO POWERFUL. WE NEED TO REMOVE IT
|
|
915
|
-
* const client = new SnowTransfer("TOKEN")
|
|
916
|
-
* client.assets.deleteAppEmoji("app id", "emoji id") // OH GOD THE UNIVERSE IS COLLAPSING
|
|
917
|
-
* // We're safe. The emoji is gone. For now...
|
|
918
|
-
*/
|
|
919
|
-
deleteAppEmoji(appId: string, emojiId: string): Promise<void>;
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
/**
|
|
923
|
-
* Methods for interacting with Entitelements
|
|
924
|
-
* @since 0.13.0
|
|
925
|
-
* @protected
|
|
926
|
-
*/
|
|
927
|
-
declare class EntitlementMethods {
|
|
928
|
-
readonly requestHandler: RequestHandler;
|
|
929
|
-
/**
|
|
930
|
-
* Create a new Entitement Method handler
|
|
931
|
-
*
|
|
932
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
933
|
-
*
|
|
934
|
-
* You can access the methods listed via `client.entitlement.method` where `client` is an initialized SnowTransfer instance
|
|
935
|
-
* @param requestHandler request handler that calls the rest api
|
|
936
|
-
*/
|
|
937
|
-
constructor(requestHandler: RequestHandler);
|
|
938
|
-
/**
|
|
939
|
-
* Returns all entitlements for a given app, active and expired
|
|
940
|
-
* @since 0.13.0
|
|
941
|
-
* @param appId Id of the app
|
|
942
|
-
* @returns Array of [entitlement objects](https://discord.com/developers/docs/resources/entitlement#entitlement-object)
|
|
943
|
-
*
|
|
944
|
-
* @example
|
|
945
|
-
* // Get all entitlements for an app
|
|
946
|
-
* const client = new SnowTransfer("TOKEN")
|
|
947
|
-
* const entitlements = await client.entitlement.getEntitlements("app id")
|
|
948
|
-
*/
|
|
949
|
-
getEntitlements(appId: string): Promise<RESTGetAPIEntitlementsResult>;
|
|
950
|
-
/**
|
|
951
|
-
* Get a single entitlement for a given app via Id
|
|
952
|
-
* @since 0.13.0
|
|
953
|
-
* @param appId Id of the app
|
|
954
|
-
* @param entitlementId Id of the entitlement
|
|
955
|
-
* @returns [entitlement object](https://discord.com/developers/docs/resources/entitlement#entitlement-object)
|
|
956
|
-
*
|
|
957
|
-
* @example
|
|
958
|
-
* // Get an entitlement for an app by Id
|
|
959
|
-
* const client = new SnowTransfer("TOKEN")
|
|
960
|
-
* const entitlement = await client.entitlement.getEntitlement("app id", "entitlement id")
|
|
961
|
-
*/
|
|
962
|
-
getEntitlement(appId: string, entitlementId: string): Promise<RESTGetAPIEntitlementResult>;
|
|
963
|
-
/**
|
|
964
|
-
* For One-Time Purchase consumable SKUs, marks a given entitlement for the user as consumed
|
|
965
|
-
* @since 0.13.0
|
|
966
|
-
* @param appId Id of the app
|
|
967
|
-
* @param entitlementId Id of the entitlement
|
|
968
|
-
* @returns Resolves the Promise on successful execution
|
|
969
|
-
*
|
|
970
|
-
* @example
|
|
971
|
-
* // Consume an entitlement
|
|
972
|
-
* const client = new SnowTransfer("TOKEN")
|
|
973
|
-
* client.entitlement.consumeEntitlement("app id", "entitlement id")
|
|
974
|
-
*/
|
|
975
|
-
consumeEntitlement(appId: string, entitlementId: string): Promise<void>;
|
|
976
|
-
/**
|
|
977
|
-
* Creates a test entitlement to a given SKU for a given guild or user. Discord will act as though that user or guild has entitlement to your premium offering
|
|
978
|
-
* @since 0.13.0
|
|
979
|
-
* @param appId Id of the app
|
|
980
|
-
* @param data Data to send
|
|
981
|
-
* @returns Partial [entitlement object](https://discord.com/developers/docs/resources/entitlement#entitlement-object)
|
|
982
|
-
*
|
|
983
|
-
* @example
|
|
984
|
-
* // Create a test entitlement for a user
|
|
985
|
-
* const client = new SnowTransfer("TOKEN")
|
|
986
|
-
* const entitlement = await client.entitlement.createTestEntitlement("app id", {
|
|
987
|
-
* sku_id: "sku id",
|
|
988
|
-
* owner_id: "user id",
|
|
989
|
-
* owner_type: 2 // type 2 is for a user. Type 1 is for a guild
|
|
990
|
-
* })
|
|
991
|
-
*/
|
|
992
|
-
createTestEntitlement(appId: string, data: RESTPostAPIEntitlementJSONBody): Promise<RESTPostAPIEntitlementResult>;
|
|
993
|
-
/**
|
|
994
|
-
* Deletes a currently-active test entitlement. Discord will act as though that user or guild no longer has entitlement to your premium offering
|
|
995
|
-
* @since 0.13.0
|
|
996
|
-
* @param appId Id of the app
|
|
997
|
-
* @param entitlementId Id of the entitlement
|
|
998
|
-
* @returns Resolves the Promise on successful execution
|
|
999
|
-
*
|
|
1000
|
-
* @example
|
|
1001
|
-
* // Delete a test entitlement
|
|
1002
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1003
|
-
* client.entitlement.deleteTestEntitlement("app id", "entitlement id")
|
|
1004
|
-
*/
|
|
1005
|
-
deleteTestEntitlement(appId: string, entitlementId: string): Promise<void>;
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
/**
|
|
1009
|
-
* Methods for interacting with Guilds
|
|
1010
|
-
* @since 0.1.0
|
|
1011
|
-
* @protected
|
|
1012
|
-
*/
|
|
1013
|
-
declare class GuildMethods {
|
|
1014
|
-
readonly requestHandler: RequestHandler;
|
|
1015
|
-
/**
|
|
1016
|
-
* Create a new Guild Method Handler
|
|
1017
|
-
*
|
|
1018
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
1019
|
-
*
|
|
1020
|
-
* You can access the methods listed via `client.guild.method`, where `client` is an initialized SnowTransfer instance
|
|
1021
|
-
* @param requestHandler request handler that calls the rest api
|
|
1022
|
-
*/
|
|
1023
|
-
constructor(requestHandler: RequestHandler);
|
|
1024
|
-
/**
|
|
1025
|
-
* Get a guild via Id
|
|
1026
|
-
*
|
|
1027
|
-
* CurrentUser must be a member of the guild
|
|
1028
|
-
* @since 0.1.0
|
|
1029
|
-
* @param guildId Id of the guild
|
|
1030
|
-
* @param withCounts when true, will return approximate member and presence counts for the guild
|
|
1031
|
-
* @returns [Guild object](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
1032
|
-
*
|
|
1033
|
-
* @example
|
|
1034
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1035
|
-
* const guild = await client.guild.getGuild("guild id")
|
|
1036
|
-
*/
|
|
1037
|
-
getGuild(guildId: string, withCounts?: boolean): Promise<RESTGetAPIGuildResult>;
|
|
1038
|
-
/**
|
|
1039
|
-
* Gets a guild's preview. If the CurrentUser is not in the guild, the guild must be lurkable
|
|
1040
|
-
* @since 0.3.0
|
|
1041
|
-
* @param guildId Id of the guild
|
|
1042
|
-
* @returns [Guild preview](https://discord.com/developers/docs/resources/guild#guild-preview-object)
|
|
1043
|
-
*
|
|
1044
|
-
* @example
|
|
1045
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1046
|
-
* const guildPreview = await client.guild.getGuildPreview("guild id")
|
|
1047
|
-
*/
|
|
1048
|
-
getGuildPreview(guildId: string): Promise<RESTGetAPIGuildPreviewResult>;
|
|
1049
|
-
/**
|
|
1050
|
-
* Update a guild
|
|
1051
|
-
* @since 0.1.0
|
|
1052
|
-
* @param guildId Id of the guild
|
|
1053
|
-
* @param data Updated guild data
|
|
1054
|
-
* @param reason Reason for updating the guild
|
|
1055
|
-
* @returns [Guild object](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
1056
|
-
*
|
|
1057
|
-
* | Permissions needed | Condition |
|
|
1058
|
-
* |--------------------|-----------|
|
|
1059
|
-
* | MANAGE_GUILD | always |
|
|
1060
|
-
*
|
|
1061
|
-
* @example
|
|
1062
|
-
* // Update the name of a guild to "Nice Guild"
|
|
1063
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1064
|
-
* const guildData = {
|
|
1065
|
-
* name: "Nice Guild"
|
|
1066
|
-
* }
|
|
1067
|
-
* client.guild.updateGuild("guild Id", guildData)
|
|
1068
|
-
*/
|
|
1069
|
-
updateGuild(guildId: string, data: RESTPatchAPIGuildJSONBody, reason?: string): Promise<RESTPatchAPIGuildResult>;
|
|
1070
|
-
/**
|
|
1071
|
-
* Get a list of all channels for a guild. Does not include threads
|
|
1072
|
-
*
|
|
1073
|
-
* CurrentUser must be a member of the guild
|
|
1074
|
-
* @since 0.1.0
|
|
1075
|
-
* @param guildId Id of the guild
|
|
1076
|
-
* @returns list of [channels](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
1077
|
-
*
|
|
1078
|
-
* @example
|
|
1079
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1080
|
-
* const channels = await client.guild.getGuildChannels("guild id")
|
|
1081
|
-
*/
|
|
1082
|
-
getGuildChannels(guildId: string): Promise<RESTGetAPIGuildChannelsResult>;
|
|
1083
|
-
/**
|
|
1084
|
-
* Create a channel within a guild
|
|
1085
|
-
* @since 0.1.0
|
|
1086
|
-
* @param guildId Id of the guild
|
|
1087
|
-
* @param data channel properties
|
|
1088
|
-
* @param reason Reason for creating the channel
|
|
1089
|
-
* @returns [channel object](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
1090
|
-
*
|
|
1091
|
-
* | Permissions needed | Condition |
|
|
1092
|
-
* |--------------------|-----------------------------------------------------------------|
|
|
1093
|
-
* | MANAGE_CHANNELS | always |
|
|
1094
|
-
* | ADMINISTRATOR | setting MANAGE_ROLES in permission_overwrites |
|
|
1095
|
-
* | * | if setting * permission in overwrites where * is any permission |
|
|
1096
|
-
*
|
|
1097
|
-
* @example
|
|
1098
|
-
* // Creates a guild voice channel with the name "nice voice channel" and with permission connect denied for the @ everyone role
|
|
1099
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1100
|
-
* const channelData = \{
|
|
1101
|
-
* name: "nice voice channel",
|
|
1102
|
-
* type: 2,
|
|
1103
|
-
* permission_overwrites: [\{ id: "guild id", type: 0, allow: "0" deny: (BigInt(1) << BigInt(20)).toString() \}]
|
|
1104
|
-
* \}
|
|
1105
|
-
* const channel = await client.guild.createGuildChannel("guild id", channelData)
|
|
1106
|
-
*/
|
|
1107
|
-
createGuildChannel(guildId: string, data: RESTPostAPIGuildChannelJSONBody, reason?: string): Promise<RESTPostAPIGuildChannelResult>;
|
|
1108
|
-
/**
|
|
1109
|
-
* Batch update the positions of channels. Only those being moved needs to be included here
|
|
1110
|
-
* @since 0.1.0
|
|
1111
|
-
* @param guildId Id of the guild
|
|
1112
|
-
* @param data Positional data to send
|
|
1113
|
-
* @param reason Reason for updating the channels' positions
|
|
1114
|
-
* @returns Resolves the Promise on successful execution
|
|
1115
|
-
*
|
|
1116
|
-
* | Permissions needed | Condition |
|
|
1117
|
-
* |--------------------|-----------|
|
|
1118
|
-
* | MANAGE_CHANNELS | always |
|
|
1119
|
-
*
|
|
1120
|
-
* @example
|
|
1121
|
-
* // Sets the position of a channel to 2 under a category channel
|
|
1122
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1123
|
-
* client.guild.updateChannelPositions("guild id", [{ id: "channel id", position: 2, parent_id: "category id" }], "they looked out of order")
|
|
1124
|
-
*/
|
|
1125
|
-
updateChannelPositions(guildId: string, data: RESTPatchAPIGuildChannelPositionsJSONBody, reason?: string): Promise<void>;
|
|
1126
|
-
/**
|
|
1127
|
-
* Returns all active threads in the guild, including public and private threads. Threads are ordered by their `id`, in descending order
|
|
1128
|
-
* @since 0.3.0
|
|
1129
|
-
* @param guildId Id of the guild
|
|
1130
|
-
* @returns All active threads and member objects of the CurrentUser that the CurrentUser has access to.
|
|
1131
|
-
*
|
|
1132
|
-
* @example
|
|
1133
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1134
|
-
* const threads = await client.guild.listActiveThreads("guild id")
|
|
1135
|
-
*/
|
|
1136
|
-
listActiveThreads(guildId: string): Promise<RESTGetAPIGuildThreadsResult>;
|
|
1137
|
-
/**
|
|
1138
|
-
* Get a guild member via Id
|
|
1139
|
-
*
|
|
1140
|
-
* CurrentUser must be a member of the guild
|
|
1141
|
-
* @since 0.1.0
|
|
1142
|
-
* @param guildId Id of the guild
|
|
1143
|
-
* @param memberId Id of the guild member
|
|
1144
|
-
* @returns [guild member](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
1145
|
-
*
|
|
1146
|
-
* @example
|
|
1147
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1148
|
-
* const member = await client.guild.getGuildMember("guild id", "member id")
|
|
1149
|
-
*/
|
|
1150
|
-
getGuildMember(guildId: string, memberId: string): Promise<RESTGetAPIGuildMemberResult>;
|
|
1151
|
-
/**
|
|
1152
|
-
* Get a list of guild members
|
|
1153
|
-
*
|
|
1154
|
-
* CurrentUser must be a member of the guild
|
|
1155
|
-
* @since 0.1.0
|
|
1156
|
-
* @param guildId Id of the guild
|
|
1157
|
-
* @param options query data
|
|
1158
|
-
* @returns list of [guild members](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
1159
|
-
*
|
|
1160
|
-
* | Intents |
|
|
1161
|
-
* |---------------|
|
|
1162
|
-
* | GUILD_MEMBERS |
|
|
1163
|
-
*
|
|
1164
|
-
* @example
|
|
1165
|
-
* // Gets 10 members from a guild
|
|
1166
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1167
|
-
* const members = await client.guild.getGuildMembers("guild id", { limit: 10 })
|
|
1168
|
-
*/
|
|
1169
|
-
getGuildMembers(guildId: string, options?: RESTGetAPIGuildMembersQuery): Promise<RESTGetAPIGuildMembersResult>;
|
|
1170
|
-
/**
|
|
1171
|
-
* Get a list of guild members that match a query
|
|
1172
|
-
* @since 0.3.0
|
|
1173
|
-
* @param guildId Id of the guild
|
|
1174
|
-
* @param options query data
|
|
1175
|
-
* @returns list of [guild members](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
1176
|
-
*
|
|
1177
|
-
* @example
|
|
1178
|
-
* // Gets all members with the username "Wolke"
|
|
1179
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1180
|
-
* const members = await client.guild.searchGuildMembers("guild id", { query: "Wolke" })
|
|
1181
|
-
*/
|
|
1182
|
-
searchGuildMembers(guildId: string, options: RESTGetAPIGuildMembersSearchQuery): Promise<RESTGetAPIGuildMembersSearchResult>;
|
|
1183
|
-
/**
|
|
1184
|
-
* Add a guild member to a guild via oauth2 access token
|
|
1185
|
-
*
|
|
1186
|
-
* CurrentUser must be a member of the guild
|
|
1187
|
-
* @since 0.1.0
|
|
1188
|
-
* @param guildId Id of the guild
|
|
1189
|
-
* @param memberId Id of the guild member
|
|
1190
|
-
* @param data object containing the needed request data
|
|
1191
|
-
* @returns [guild member](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure) or void if the member is already in the guild
|
|
1192
|
-
*
|
|
1193
|
-
* | Permissions needed | Condition |
|
|
1194
|
-
* |-----------------------|-----------|
|
|
1195
|
-
* | CREATE_INSTANT_INVITE | always |
|
|
1196
|
-
*
|
|
1197
|
-
* | OAUTH2 Scopes |
|
|
1198
|
-
* |---------------|
|
|
1199
|
-
* | guilds.join |
|
|
1200
|
-
*
|
|
1201
|
-
* @example
|
|
1202
|
-
* // add a user to a server
|
|
1203
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1204
|
-
* const memberData = {
|
|
1205
|
-
* access_token: "access token of a user with the guilds.join scope"
|
|
1206
|
-
* }
|
|
1207
|
-
* client.guild.addGuildMember("guildId", "memberId", memberData)
|
|
1208
|
-
*/
|
|
1209
|
-
addGuildMember(guildId: string, memberId: string, data: RESTPutAPIGuildMemberJSONBody): Promise<RESTPutAPIGuildMemberResult>;
|
|
1210
|
-
/**
|
|
1211
|
-
* Update properties of a guild member
|
|
1212
|
-
* @since 0.1.0
|
|
1213
|
-
* @param guildId Id of the guild
|
|
1214
|
-
* @param memberId Id of the guild member
|
|
1215
|
-
* @param data Updated properties
|
|
1216
|
-
* @param reason Reason for updating the guild member
|
|
1217
|
-
* @returns Resolves the Promise on successful execution
|
|
1218
|
-
*
|
|
1219
|
-
* | Permissions needed | Condition |
|
|
1220
|
-
* |--------------------|--------------|
|
|
1221
|
-
* | MANAGE_NICKNAMES | Nick Updates |
|
|
1222
|
-
* | MANAGE_ROLES | Role Updates |
|
|
1223
|
-
* | MUTE_MEMBERS | Mute Updates |
|
|
1224
|
-
* | DEAFEN_MEMBERS | Deaf Updates |
|
|
1225
|
-
* | MOVE_MEMBERS | Voice Move |
|
|
1226
|
-
* | CONNECT | Voice Move |
|
|
1227
|
-
* | MODERATE_MEMBERS | Timeouts |
|
|
1228
|
-
*
|
|
1229
|
-
* @example
|
|
1230
|
-
* // Reset the nickname of a guild member
|
|
1231
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1232
|
-
* const memberData = {
|
|
1233
|
-
* nick: "" // You can reset nicknames by providing an empty string as the value of data.nick
|
|
1234
|
-
* }
|
|
1235
|
-
* const member = await client.guild.updateGuildMember("guild Id", "memberId", memberData)
|
|
1236
|
-
*/
|
|
1237
|
-
updateGuildMember(guildId: string, memberId: string, data: RESTPatchAPIGuildMemberJSONBody, reason?: string): Promise<RESTPatchAPIGuildMemberResult>;
|
|
1238
|
-
/**
|
|
1239
|
-
* Update the nick of the CurrentMember
|
|
1240
|
-
* @since 0.1.0
|
|
1241
|
-
* @param guildId Id of the guild
|
|
1242
|
-
* @param data Data to update self with
|
|
1243
|
-
* @param reason Reason for updating self
|
|
1244
|
-
* @returns Resolves the Promise on successful execution
|
|
1245
|
-
*
|
|
1246
|
-
* | Permissions needed | Condition |
|
|
1247
|
-
* |--------------------|-----------|
|
|
1248
|
-
* | CHANGE_NICKNAME | always |
|
|
1249
|
-
*
|
|
1250
|
-
* @example
|
|
1251
|
-
* // change nick of bot to "Nice Nick"
|
|
1252
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1253
|
-
* const nickData = {
|
|
1254
|
-
* nick: "Nice Nick"
|
|
1255
|
-
* }
|
|
1256
|
-
* client.guild.updateSelf("guildId", nickData)
|
|
1257
|
-
*/
|
|
1258
|
-
updateSelf(guildId: string, data: RESTPatchAPICurrentGuildMemberJSONBody, reason?: string): Promise<APIGuildMember>;
|
|
1259
|
-
/**
|
|
1260
|
-
* Add a role to a guild member
|
|
1261
|
-
* @since 0.1.0
|
|
1262
|
-
* @param guildId Id of the guild
|
|
1263
|
-
* @param memberId Id of the guild member
|
|
1264
|
-
* @param roleId Id of the role
|
|
1265
|
-
* @param reason The reason for the role to be added
|
|
1266
|
-
* @returns Resolves the Promise on successful execution
|
|
1267
|
-
*
|
|
1268
|
-
* | Permissions needed | Condition |
|
|
1269
|
-
* |--------------------|-----------|
|
|
1270
|
-
* | MANAGE_ROLES | always |
|
|
1271
|
-
*
|
|
1272
|
-
* @example
|
|
1273
|
-
* // add a role to a member with a reason of "I want to add a role"
|
|
1274
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1275
|
-
* client.guild.addGuildMemberRole("guildId", "memberId", "roleId", "I want to add a role")
|
|
1276
|
-
*/
|
|
1277
|
-
addGuildMemberRole(guildId: string, memberId: string, roleId: string, reason?: string): Promise<void>;
|
|
1278
|
-
/**
|
|
1279
|
-
* Remove a role from a guild member
|
|
1280
|
-
* @since 0.1.0
|
|
1281
|
-
* @param guildId Id of the guild
|
|
1282
|
-
* @param memberId Id of the guild member
|
|
1283
|
-
* @param roleId Id of the role
|
|
1284
|
-
* @param reason The reason for the role to be removed
|
|
1285
|
-
* @returns Resolves the Promise on successful execution
|
|
1286
|
-
*
|
|
1287
|
-
* | Permissions needed | Condition |
|
|
1288
|
-
* |--------------------|-----------|
|
|
1289
|
-
* | MANAGE_ROLES | always |
|
|
1290
|
-
*
|
|
1291
|
-
* @example
|
|
1292
|
-
* // remove a role from a member with a reason of "I want to remove a role"
|
|
1293
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1294
|
-
* client.guild.removeGuildMemberRole("guildId", "memberId", "roleId", "I want to remove a role")
|
|
1295
|
-
*/
|
|
1296
|
-
removeGuildMemberRole(guildId: string, memberId: string, roleId: string, reason?: string): Promise<void>;
|
|
1297
|
-
/**
|
|
1298
|
-
* Remove a guild member (aka kick them)
|
|
1299
|
-
* @since 0.1.0
|
|
1300
|
-
* @param guildId Id of the guild
|
|
1301
|
-
* @param memberId Id of the guild member
|
|
1302
|
-
* @param reason Reason for kicking the member
|
|
1303
|
-
* @returns Resolves the Promise on successful execution
|
|
1304
|
-
*
|
|
1305
|
-
* | Permissions needed | Condition |
|
|
1306
|
-
* |--------------------|-----------|
|
|
1307
|
-
* | KICK_MEMBERS | always |
|
|
1308
|
-
*
|
|
1309
|
-
* @example
|
|
1310
|
-
* // Kick a member with a reason of "spam"
|
|
1311
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1312
|
-
* client.guild.removeGuildMember("guild Id", "memberId", "spam")
|
|
1313
|
-
*/
|
|
1314
|
-
removeGuildMember(guildId: string, memberId: string, reason?: string): Promise<void>;
|
|
1315
|
-
/**
|
|
1316
|
-
* Get bans of a guild
|
|
1317
|
-
* @since 0.1.0
|
|
1318
|
-
* @param guildId Id of the guild
|
|
1319
|
-
* @param options Query string options
|
|
1320
|
-
* @returns List of [bans](https://discord.com/developers/docs/resources/guild#ban-object-ban-structure)
|
|
1321
|
-
*
|
|
1322
|
-
* | Permissions needed | Condition |
|
|
1323
|
-
* |--------------------|-----------|
|
|
1324
|
-
* | BAN_MEMBERS | always |
|
|
1325
|
-
*
|
|
1326
|
-
* @example
|
|
1327
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1328
|
-
* const bans = await client.guild.getGuildBans("guildId")
|
|
1329
|
-
*/
|
|
1330
|
-
getGuildBans(guildId: string, options?: RESTGetAPIGuildBansQuery): Promise<RESTGetAPIGuildBansResult>;
|
|
1331
|
-
/**
|
|
1332
|
-
* Get a specific ban of a guild member
|
|
1333
|
-
* @since 0.4.2
|
|
1334
|
-
* @param guildId Id of the guild
|
|
1335
|
-
* @param memberId Id of the member
|
|
1336
|
-
* @returns [ban](https://discord.com/developers/docs/resources/guild#ban-object-ban-structure) object
|
|
1337
|
-
*
|
|
1338
|
-
* @throws a `DiscordAPIError` if the member is not banned
|
|
1339
|
-
*
|
|
1340
|
-
* | Permissions needed | Condition |
|
|
1341
|
-
* |--------------------|-----------|
|
|
1342
|
-
* | BAN_MEMBERS | always |
|
|
1343
|
-
*
|
|
1344
|
-
* @example
|
|
1345
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1346
|
-
* const ban = await client.guild.getGuildBan("guildId", "memberId")
|
|
1347
|
-
*/
|
|
1348
|
-
getGuildBan(guildId: string, memberId: string): Promise<RESTGetAPIGuildBanResult>;
|
|
1349
|
-
/**
|
|
1350
|
-
* Ban a guild member
|
|
1351
|
-
* @since 0.1.0
|
|
1352
|
-
* @param guildId Id of the guild
|
|
1353
|
-
* @param memberId Id of the guild member
|
|
1354
|
-
* @param data object with delete_message_days property
|
|
1355
|
-
* @param reason Reason for banning the member
|
|
1356
|
-
* @returns Resolves the Promise on successful execution
|
|
1357
|
-
*
|
|
1358
|
-
* | Permissions needed | Condition |
|
|
1359
|
-
* |--------------------|-----------|
|
|
1360
|
-
* | BAN_MEMBERS | always |
|
|
1361
|
-
*
|
|
1362
|
-
* @example
|
|
1363
|
-
* // Ban a user with a reason and delete the last 2 days of their messages
|
|
1364
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1365
|
-
* const banData = {
|
|
1366
|
-
* delete_message_days":2
|
|
1367
|
-
* }
|
|
1368
|
-
* client.guild.createGuildBan("guild Id", "memberId", banData, "Memes were not good enough")
|
|
1369
|
-
*/
|
|
1370
|
-
createGuildBan(guildId: string, memberId: string, data?: RESTPutAPIGuildBanJSONBody, reason?: string): Promise<void>;
|
|
1371
|
-
/**
|
|
1372
|
-
* Remove a ban of a user
|
|
1373
|
-
* @since 0.1.0
|
|
1374
|
-
* @param guildId Id of the guild
|
|
1375
|
-
* @param memberId Id of the guild member
|
|
1376
|
-
* @param reason Reason for removing the ban
|
|
1377
|
-
* @returns Resolves the Promise on successful execution
|
|
1378
|
-
*
|
|
1379
|
-
* | Permissions needed | Condition |
|
|
1380
|
-
* |--------------------|-----------|
|
|
1381
|
-
* | BAN_MEMBERS | always |
|
|
1382
|
-
*
|
|
1383
|
-
* @example
|
|
1384
|
-
* // Remove a ban of a user with a reason
|
|
1385
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1386
|
-
* client.guild.removeGuildBan("guildId", "memberId", "This guy was cool")
|
|
1387
|
-
*/
|
|
1388
|
-
removeGuildBan(guildId: string, memberId: string, reason?: string): Promise<void>;
|
|
1389
|
-
/**
|
|
1390
|
-
* Get a list of roles for a guild
|
|
1391
|
-
* @since 0.1.0
|
|
1392
|
-
* @param guildId Id of the guild
|
|
1393
|
-
* @returns array of [roles](https://discord.com/developers/docs/topics/permissions#role-object)
|
|
1394
|
-
*
|
|
1395
|
-
* | Permissions needed | Condition |
|
|
1396
|
-
* |--------------------|-----------|
|
|
1397
|
-
* | MANAGE_ROLES | always |
|
|
1398
|
-
*
|
|
1399
|
-
* @example
|
|
1400
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1401
|
-
* const roles = await client.guild.getGuildRoles("guildId")
|
|
1402
|
-
*/
|
|
1403
|
-
getGuildRoles(guildId: string): Promise<RESTGetAPIGuildRolesResult>;
|
|
1404
|
-
/**
|
|
1405
|
-
* Create a new Role
|
|
1406
|
-
* @since 0.1.0
|
|
1407
|
-
* @param guildId Id of the guild
|
|
1408
|
-
* @param data data with role properties
|
|
1409
|
-
* @param reason Reason for creating the role
|
|
1410
|
-
* @returns [role](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
1411
|
-
*
|
|
1412
|
-
* | Permissions needed | Condition |
|
|
1413
|
-
* |--------------------|-----------|
|
|
1414
|
-
* | MANAGE_ROLES | always |
|
|
1415
|
-
*
|
|
1416
|
-
* @example
|
|
1417
|
-
* // Create a role with the name "Nice Role" and a color of a soft blue
|
|
1418
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1419
|
-
* const roleData = {
|
|
1420
|
-
* name: "Nice Role",
|
|
1421
|
-
* color: 0x7c7cf8
|
|
1422
|
-
* }
|
|
1423
|
-
* client.guild.createGuildRole("guild Id", roleData)
|
|
1424
|
-
*/
|
|
1425
|
-
createGuildRole(guildId: string, data?: RESTPostAPIGuildRoleJSONBody, reason?: string): Promise<RESTPostAPIGuildRoleResult>;
|
|
1426
|
-
/**
|
|
1427
|
-
* Modify the positions of roles
|
|
1428
|
-
* @since 0.1.0
|
|
1429
|
-
* @param guildId Id of the guild
|
|
1430
|
-
* @param data Role data to update
|
|
1431
|
-
* @param reason Reason for moving the roles
|
|
1432
|
-
* @returns array of [roles](https://discord.com/developers/docs/topics/permissions#role-object)
|
|
1433
|
-
*
|
|
1434
|
-
* | Permissions needed | Condition |
|
|
1435
|
-
* |--------------------|-----------|
|
|
1436
|
-
* | MANAGE_ROLES | always |
|
|
1437
|
-
*
|
|
1438
|
-
* @example
|
|
1439
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1440
|
-
* const roles = await client.guild.updateGuildRolePositions("guildId", [{ id: "guild id", position: 1 }, { id: "role id 2", position: 2 }])
|
|
1441
|
-
*/
|
|
1442
|
-
updateGuildRolePositions(guildId: string, data: RESTPatchAPIGuildRolePositionsJSONBody, reason?: string): Promise<RESTPatchAPIGuildRolePositionsResult>;
|
|
1443
|
-
/**
|
|
1444
|
-
* Update a guild role
|
|
1445
|
-
* @since 0.1.0
|
|
1446
|
-
* @param guildId Id of the guild
|
|
1447
|
-
* @param roleId Id of the role
|
|
1448
|
-
* @param data updated properties of the role
|
|
1449
|
-
* @param reason Reason for updating the role
|
|
1450
|
-
* @returns [Updated Role](https://discord.com/developers/docs/topics/permissions#role-object)
|
|
1451
|
-
*
|
|
1452
|
-
* | Permissions needed | Condition |
|
|
1453
|
-
* |--------------------|-----------|
|
|
1454
|
-
* | MANAGE_ROLES | always |
|
|
1455
|
-
*
|
|
1456
|
-
* @example
|
|
1457
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1458
|
-
* const roleData = {
|
|
1459
|
-
* name: "Nicer Role",
|
|
1460
|
-
* }
|
|
1461
|
-
* client.guild.updateGuildRole("guildId", "roleId", roleData)
|
|
1462
|
-
*/
|
|
1463
|
-
updateGuildRole(guildId: string, roleId: string, data: RESTPatchAPIGuildRoleJSONBody, reason?: string): Promise<RESTPatchAPIGuildRoleResult>;
|
|
1464
|
-
/**
|
|
1465
|
-
* Delete a role from the guild
|
|
1466
|
-
* @since 0.1.0
|
|
1467
|
-
* @param guildId Id of the guild
|
|
1468
|
-
* @param roleId Id of the role
|
|
1469
|
-
* @param reason Reason for deleting the role
|
|
1470
|
-
* @returns Resolves the Promise on successful execution
|
|
1471
|
-
*
|
|
1472
|
-
* | Permissions needed | Condition |
|
|
1473
|
-
* |--------------------|-----------|
|
|
1474
|
-
* | MANAGE_ROLES | always |
|
|
1475
|
-
*
|
|
1476
|
-
* @example
|
|
1477
|
-
* // Deletes a role with a reason "This role is too cool"
|
|
1478
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1479
|
-
* client.guild.deleteGuildRole("guildId", "roleId", "This role is too cool")
|
|
1480
|
-
*/
|
|
1481
|
-
removeGuildRole(guildId: string, roleId: string, reason?: string): Promise<void>;
|
|
1482
|
-
/**
|
|
1483
|
-
* Get the amount of members that would be pruned when a prune with the passed amount of days would be started
|
|
1484
|
-
* @since 0.1.0
|
|
1485
|
-
* @param guildId Id of the guild
|
|
1486
|
-
* @param options Object with prune data
|
|
1487
|
-
* @returns Object with a "pruned" key indicating the amount of members that would be pruned
|
|
1488
|
-
*
|
|
1489
|
-
* | Permissions needed | Condition |
|
|
1490
|
-
* |--------------------|-----------|
|
|
1491
|
-
* | KICK_MEMBERS | always |
|
|
1492
|
-
*
|
|
1493
|
-
* @example
|
|
1494
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1495
|
-
* const data = await client.guild.getGuildPruneCount("guildId", { days: 7 })
|
|
1496
|
-
*/
|
|
1497
|
-
getGuildPruneCount(guildId: string, options?: RESTGetAPIGuildPruneCountQuery): Promise<RESTGetAPIGuildPruneCountResult>;
|
|
1498
|
-
/**
|
|
1499
|
-
* Start a prune
|
|
1500
|
-
* @since 0.1.0
|
|
1501
|
-
* @param guildId Id of the guild
|
|
1502
|
-
* @param data Object with prune data
|
|
1503
|
-
* @param reason Reason for starting the prune
|
|
1504
|
-
* @returns Object with a "pruned" key indicating the amount of members that were pruned
|
|
1505
|
-
*
|
|
1506
|
-
* | Permissions needed | Condition |
|
|
1507
|
-
* |--------------------|-----------|
|
|
1508
|
-
* | KICK_MEMBERS | always |
|
|
1509
|
-
*
|
|
1510
|
-
* @example
|
|
1511
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1512
|
-
* const data = await client.guild.startGuildPrune("guildId", { days: 7 })
|
|
1513
|
-
*/
|
|
1514
|
-
startGuildPrune(guildId: string, data: RESTPostAPIGuildPruneJSONBody & {
|
|
1515
|
-
compute_prune_count: true;
|
|
1516
|
-
}, reason?: string): Promise<RESTPostAPIGuildPruneResult & {
|
|
1517
|
-
pruned: number;
|
|
1518
|
-
}>;
|
|
1519
|
-
startGuildPrune(guildId: string, data: RESTPostAPIGuildPruneJSONBody & {
|
|
1520
|
-
compute_prune_count: false;
|
|
1521
|
-
}, reason?: string): Promise<RESTPostAPIGuildPruneResult & {
|
|
1522
|
-
pruned: null;
|
|
1523
|
-
}>;
|
|
1524
|
-
/**
|
|
1525
|
-
* Get a list of voice regions for the guild, includes vip-regions unlike voice.getVoiceRegions
|
|
1526
|
-
* @since 0.1.0
|
|
1527
|
-
* @param guildId Id of the guild
|
|
1528
|
-
* @returns List of [voice regions](https://discord.com/developers/docs/resources/voice#voice-region-object)
|
|
1529
|
-
*
|
|
1530
|
-
* @example
|
|
1531
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1532
|
-
* const regions = await client.guild.getGuildVoiceRegions("guildId")
|
|
1533
|
-
*/
|
|
1534
|
-
getGuildVoiceRegions(guildId: string): Promise<RESTGetAPIGuildVoiceRegionsResult>;
|
|
1535
|
-
/**
|
|
1536
|
-
* Get invites for a guild
|
|
1537
|
-
* @since 0.1.0
|
|
1538
|
-
* @param guildId Id of the guild
|
|
1539
|
-
* @returns List of [invites](https://discord.com/developers/docs/resources/invite#invite-object) (with metadata)
|
|
1540
|
-
*
|
|
1541
|
-
* | Permissions needed | Condition |
|
|
1542
|
-
* |--------------------|-----------|
|
|
1543
|
-
* | MANAGE_GUILD | always |
|
|
1544
|
-
*
|
|
1545
|
-
* @example
|
|
1546
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1547
|
-
* const invites = await client.guild.getGuildInvites("guildId")
|
|
1548
|
-
*/
|
|
1549
|
-
getGuildInvites(guildId: string): Promise<RESTGetAPIGuildInvitesResult>;
|
|
1550
|
-
/**
|
|
1551
|
-
* Get integrations for a guild
|
|
1552
|
-
* @since 0.1.0
|
|
1553
|
-
* @param guildId Id of the guild
|
|
1554
|
-
* @returns List of [integration objects](https://discord.com/developers/docs/resources/guild#integration-object)
|
|
1555
|
-
*
|
|
1556
|
-
* | Permissions needed | Condition |
|
|
1557
|
-
* |--------------------|-----------|
|
|
1558
|
-
* | MANAGE_GUILD | always |
|
|
1559
|
-
*
|
|
1560
|
-
* @example
|
|
1561
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1562
|
-
* const integrations = await client.guild.getGuildIntegrations("guildId")
|
|
1563
|
-
*/
|
|
1564
|
-
getGuildIntegrations(guildId: string): Promise<RESTGetAPIGuildIntegrationsResult>;
|
|
1565
|
-
/**
|
|
1566
|
-
* Delete a guild integration
|
|
1567
|
-
* @since 0.1.0
|
|
1568
|
-
* @param guildId Id of the guild
|
|
1569
|
-
* @param integrationId Id of the integration
|
|
1570
|
-
* @param reason Reason for removing the integration
|
|
1571
|
-
* @returns Resolves the Promise on successful execution
|
|
1572
|
-
*
|
|
1573
|
-
* | Permissions needed | Condition |
|
|
1574
|
-
* |--------------------|-----------|
|
|
1575
|
-
* | MANAGE_GUILD | always |
|
|
1576
|
-
*
|
|
1577
|
-
* @example
|
|
1578
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1579
|
-
* await client.guild.deleteGuildIntegration("guildId", "integrationId", "Didn't need anymore")
|
|
1580
|
-
*/
|
|
1581
|
-
removeGuildIntegration(guildId: string, integrationId: string, reason?: string): Promise<void>;
|
|
1582
|
-
/**
|
|
1583
|
-
* Get a guild widget settings object
|
|
1584
|
-
* @since 0.3.0
|
|
1585
|
-
* @param guildId Id of the guild
|
|
1586
|
-
* @returns [Guild Widget settings](https://discord.com/developers/docs/resources/guild#guild-widget-settings-object-guild-widget-settings-structure)
|
|
1587
|
-
*
|
|
1588
|
-
* | Permissions needed | Condition |
|
|
1589
|
-
* |--------------------|-----------|
|
|
1590
|
-
* | MANAGE_GUILD | always |
|
|
1591
|
-
*
|
|
1592
|
-
* @example
|
|
1593
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1594
|
-
* const widgetSettings = await client.guild.getGuildWidgetSettings("guildId")
|
|
1595
|
-
*/
|
|
1596
|
-
getGuildWidgetSettings(guildId: string): Promise<RESTGetAPIGuildWidgetSettingsResult>;
|
|
1597
|
-
/**
|
|
1598
|
-
* Update a guild widget settings object
|
|
1599
|
-
* @since 0.3.0
|
|
1600
|
-
* @param guildId Id of the guild
|
|
1601
|
-
* @param data widget settings
|
|
1602
|
-
* @param reason Reason for updating the guild widget settings
|
|
1603
|
-
* @returns Updated [Guild Widget settings](https://discord.com/developers/docs/resources/guild#guild-widget-settings-object-guild-widget-settings-structure)
|
|
1604
|
-
*
|
|
1605
|
-
* | Permissions needed | Condition |
|
|
1606
|
-
* |--------------------|-----------|
|
|
1607
|
-
* | MANAGE_GUILD | always |
|
|
1608
|
-
*
|
|
1609
|
-
* @example
|
|
1610
|
-
* // Sets a widget as disabled
|
|
1611
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1612
|
-
* const widgetSettings = await client.guild.updateGuildWidgetSettings("guildId", { enabled: false })
|
|
1613
|
-
*/
|
|
1614
|
-
updateGuildWidgetSettings(guildId: string, data: Partial<RESTPatchAPIGuildWidgetSettingsJSONBody>, reason?: string): Promise<RESTPatchAPIGuildWidgetSettingsResult>;
|
|
1615
|
-
/**
|
|
1616
|
-
* Gets a guild widget object
|
|
1617
|
-
* @since 0.3.0
|
|
1618
|
-
* @param guildId Id of the guild
|
|
1619
|
-
* @returns [Guild Widget](https://discord.com/developers/docs/resources/guild#guild-widget-object)
|
|
1620
|
-
*
|
|
1621
|
-
* @example
|
|
1622
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1623
|
-
* const widget = await client.guild.getGuildWidget("guildId")
|
|
1624
|
-
*/
|
|
1625
|
-
getGuildWidget(guildId: string): Promise<APIGuildWidget>;
|
|
1626
|
-
/**
|
|
1627
|
-
* Get a guild's vanity URL code
|
|
1628
|
-
* @since 0.3.0
|
|
1629
|
-
* @param guildId Id of the guild
|
|
1630
|
-
* @returns partial [invite object](https://discord.com/developers/docs/resources/guild#get-guild-vanity-url-example-partial-invite-object)
|
|
1631
|
-
*
|
|
1632
|
-
* | Permissions needed | Condition |
|
|
1633
|
-
* |--------------------|-----------|
|
|
1634
|
-
* | MANAGE_GUILD | always |
|
|
1635
|
-
*
|
|
1636
|
-
* @example
|
|
1637
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1638
|
-
* const vanityUrl = await client.guild.getGuildVanityUrl("guildId")
|
|
1639
|
-
*/
|
|
1640
|
-
getGuildVanityURL(guildId: string): Promise<RESTGetAPIGuildVanityUrlResult>;
|
|
1641
|
-
/**
|
|
1642
|
-
* Get a guild's welcome screen object
|
|
1643
|
-
* @since 0.3.0
|
|
1644
|
-
* @param guildId Id of the guild
|
|
1645
|
-
* @returns [Guild Welcome Screen](https://discord.com/developers/docs/resources/guild#welcome-screen-object)
|
|
1646
|
-
*
|
|
1647
|
-
* | Permissions needed | Condition |
|
|
1648
|
-
* |--------------------|--------------------------------------|
|
|
1649
|
-
* | MANAGE_GUILD | if the welcome screen is not enabled |
|
|
1650
|
-
*
|
|
1651
|
-
* @example
|
|
1652
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1653
|
-
* const welcomeScreen = await client.guild.getGuildWelcomeScreen("guildId")
|
|
1654
|
-
*/
|
|
1655
|
-
getGuildWelcomeScreen(guildId: string): Promise<RESTGetAPIGuildWelcomeScreenResult>;
|
|
1656
|
-
/**
|
|
1657
|
-
* Update a guild welcome screen object
|
|
1658
|
-
* @since 0.3.0
|
|
1659
|
-
* @param guildId Id of guild
|
|
1660
|
-
* @param data Welcome screen data
|
|
1661
|
-
* @param reason Reason for editing the welcome screen
|
|
1662
|
-
* @returns [Guild Welcome Screen](https://discord.com/developers/docs/resources/guild#welcome-screen-object)
|
|
1663
|
-
*
|
|
1664
|
-
* | Permissions needed | Condition |
|
|
1665
|
-
* |--------------------|-----------|
|
|
1666
|
-
* | MANAGE_GUILD | always |
|
|
1667
|
-
*
|
|
1668
|
-
* @example
|
|
1669
|
-
* // Disabled the welcome screen
|
|
1670
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1671
|
-
* const welcomeScreen = await client.guild.updateGuildWelcomeScreen("guildId", { enabled: false })
|
|
1672
|
-
*/
|
|
1673
|
-
editGuildWelcomeScreen(guildId: string, data: RESTPatchAPIGuildWelcomeScreenJSONBody, reason?: string): Promise<RESTPatchAPIGuildWelcomeScreenResult>;
|
|
1674
|
-
/**
|
|
1675
|
-
* Updates the current user's voice state in a stage channel
|
|
1676
|
-
* @since 0.3.0
|
|
1677
|
-
* @param guildId Id of the guild
|
|
1678
|
-
* @param data Data of the voice state
|
|
1679
|
-
* @returns Resolves the Promise on successful execution
|
|
1680
|
-
*
|
|
1681
|
-
* | Permissions needed | Condition |
|
|
1682
|
-
* |--------------------|-------------------------------------|
|
|
1683
|
-
* | MUTE_MEMBERS | when trying to un-suppress yourself |
|
|
1684
|
-
* | REQUEST_TO_SPEAK | when trying to request to speak |
|
|
1685
|
-
*
|
|
1686
|
-
* @example
|
|
1687
|
-
* // Unsuppresses the CurrentUser in the stage channel they're in
|
|
1688
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1689
|
-
* client.guild.updateGuildVoiceState("guildId", { channel_id: "channel id", suppress: false })
|
|
1690
|
-
*/
|
|
1691
|
-
updateCurrentUserVoiceState(guildId: string, data: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody): Promise<void>;
|
|
1692
|
-
/**
|
|
1693
|
-
* Updates a user's voice state in a stage channel
|
|
1694
|
-
* @since 0.3.0
|
|
1695
|
-
* @param guildId Id of the guild
|
|
1696
|
-
* @param userId Id of the user
|
|
1697
|
-
* @param data Data of the voice state
|
|
1698
|
-
* @returns Resolves the Promise on successful execution
|
|
1699
|
-
*
|
|
1700
|
-
* | Permissions needed | Condition |
|
|
1701
|
-
* |--------------------|-------------------------------------|
|
|
1702
|
-
* | MUTE_MEMBERS | when trying to suppress/un-suppress |
|
|
1703
|
-
*
|
|
1704
|
-
* @example
|
|
1705
|
-
* // Suppresses the user in the stage channel they're in
|
|
1706
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1707
|
-
* client.guild.updateGuildVoiceState("guildId", "userId", { channel_id: "channel id", suppress: true })
|
|
1708
|
-
*/
|
|
1709
|
-
updateUserVoiceState(guildId: string, userId: string, data: RESTPatchAPIGuildVoiceStateUserJSONBody): Promise<void>;
|
|
1710
|
-
/**
|
|
1711
|
-
* Searches a guild for messages that match a query
|
|
1712
|
-
* @since 0.17.6
|
|
1713
|
-
* @param guildId Id of the guild
|
|
1714
|
-
* @param query Options for the search
|
|
1715
|
-
* @returns An Array of [Messages](https://docs.discord.com/developers/resources/message#message-object)
|
|
1716
|
-
*
|
|
1717
|
-
* | Permissions needed | Condition |
|
|
1718
|
-
* |----------------------|-----------|
|
|
1719
|
-
* | READ_MESSAGE_HISTORY | Always |
|
|
1720
|
-
*
|
|
1721
|
-
* @example
|
|
1722
|
-
* // Finds messages that have the word "poggers" in their content
|
|
1723
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1724
|
-
* const messages = await client.guild.searchGuildMessages("guildId", { content: "poggers" })
|
|
1725
|
-
*/
|
|
1726
|
-
searchGuildMessages(guildId: string, query?: Record<string, any>): Promise<any>;
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
/**
|
|
1730
|
-
* Methods for interacting with Guild Scheduled Events
|
|
1731
|
-
* @since 0.3.6
|
|
1732
|
-
* @protected
|
|
1733
|
-
*/
|
|
1734
|
-
declare class GuildScheduledEventMethods {
|
|
1735
|
-
readonly requestHandler: RequestHandler;
|
|
1736
|
-
/**
|
|
1737
|
-
* Create a new Guild Scheduled Event Method Handler
|
|
1738
|
-
*
|
|
1739
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
1740
|
-
*
|
|
1741
|
-
* You can access the methods listed via `client.guildScheduledEvent.method`, where `client` is an initialized SnowTransfer instance
|
|
1742
|
-
* @param requestHandler request handler that calls the rest api
|
|
1743
|
-
*/
|
|
1744
|
-
constructor(requestHandler: RequestHandler);
|
|
1745
|
-
/**
|
|
1746
|
-
* Get all scheduled events for a guild
|
|
1747
|
-
* @since 0.3.6
|
|
1748
|
-
* @param guildId The Id of the guild
|
|
1749
|
-
* @param withCounts Include number of users subscribed to each event
|
|
1750
|
-
* @returns An array of [guild scheduled events](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure)
|
|
1751
|
-
*
|
|
1752
|
-
* @example
|
|
1753
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1754
|
-
* const events = await client.guildScheduledEvent.listGuildScheduledEvents(guildId)
|
|
1755
|
-
*/
|
|
1756
|
-
listGuildScheduledEvents(guildId: string, withCounts?: boolean): Promise<RESTGetAPIGuildScheduledEventsResult>;
|
|
1757
|
-
/**
|
|
1758
|
-
* Create a scheduled event for a guild
|
|
1759
|
-
* @since 0.3.6
|
|
1760
|
-
* @param guildId The Id of the guild
|
|
1761
|
-
* @param data Data for the new scheduled event
|
|
1762
|
-
* @param reason Reason for creating the scheduled event
|
|
1763
|
-
* @returns A [scheduled event](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure)
|
|
1764
|
-
*
|
|
1765
|
-
* | Permissions needed | Condition |
|
|
1766
|
-
* |--------------------|----------------------------------|
|
|
1767
|
-
* | MANAGE_EVENTS | always |
|
|
1768
|
-
* | MANAGE_CHANNELS | If entity_type is STAGE_INSTANCE |
|
|
1769
|
-
* | MUTE_MEMBERS | If entity_type is STAGE_INSTANCE |
|
|
1770
|
-
* | MOVE_MEMBERS | If entity_type is STAGE_INSTANCE |
|
|
1771
|
-
* | VIEW_CHANNEL | If entity_type is VOICE |
|
|
1772
|
-
* | CONNECT | If entity_type is VOICE |
|
|
1773
|
-
*
|
|
1774
|
-
* @example
|
|
1775
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1776
|
-
* const eventData = {
|
|
1777
|
-
* name: "My event!",
|
|
1778
|
-
* entity_type: 1,
|
|
1779
|
-
* start_time: "2020-01-01T00:00:00Z",
|
|
1780
|
-
* privacy_level: 1
|
|
1781
|
-
* }
|
|
1782
|
-
* const event = await client.guildScheduledEvent.createGuildScheduledEvent(guildId, eventData)
|
|
1783
|
-
*/
|
|
1784
|
-
createGuildScheduledEvent(guildId: string, data: RESTPostAPIGuildScheduledEventJSONBody, reason?: string): Promise<RESTPostAPIGuildScheduledEventResult>;
|
|
1785
|
-
/**
|
|
1786
|
-
* Get a specific scheduled event for a guild
|
|
1787
|
-
* @since 0.3.6
|
|
1788
|
-
* @param guildId The Id of the guild
|
|
1789
|
-
* @param eventId The Id of the event
|
|
1790
|
-
* @param withCounts Include number of users subscribed to this event
|
|
1791
|
-
* @returns A [scheduled event](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure)
|
|
1792
|
-
*
|
|
1793
|
-
* | Permissions needed | Condition |
|
|
1794
|
-
* |--------------------|-------------------------------------------|
|
|
1795
|
-
* | VIEW_CHANNEL | if entity_type is STAGE_INSTANCE or VOICE |
|
|
1796
|
-
*
|
|
1797
|
-
* @example
|
|
1798
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1799
|
-
* const event = await client.guildScheduledEvent.getGuildScheduledEvent(guildId, eventId)
|
|
1800
|
-
*/
|
|
1801
|
-
getGuildScheduledEvent(guildId: string, eventId: string, withCounts?: boolean): Promise<RESTGetAPIGuildScheduledEventResult>;
|
|
1802
|
-
/**
|
|
1803
|
-
* Edit the details of a scheduled event for a guild
|
|
1804
|
-
* @since 0.3.6
|
|
1805
|
-
* @param guildId The Id of the guild
|
|
1806
|
-
* @param eventId The Id of the event
|
|
1807
|
-
* @param data Edited scheduled event data
|
|
1808
|
-
* @param reason Reason for editing the scheduled event
|
|
1809
|
-
* @returns A [scheduled event](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure)
|
|
1810
|
-
*
|
|
1811
|
-
* | Permissions needed | Condition |
|
|
1812
|
-
* |--------------------|----------------------------------|
|
|
1813
|
-
* | MANAGE_EVENTS | always |
|
|
1814
|
-
* | MANAGE_CHANNELS | If entity_type is STAGE_INSTANCE |
|
|
1815
|
-
* | MUTE_MEMBERS | If entity_type is STAGE_INSTANCE |
|
|
1816
|
-
* | MOVE_MEMBERS | If entity_type is STAGE_INSTANCE |
|
|
1817
|
-
* | VIEW_CHANNEL | If entity_type is VOICE |
|
|
1818
|
-
* | CONNECT | If entity_type is VOICE |
|
|
1819
|
-
*
|
|
1820
|
-
* @example
|
|
1821
|
-
* // Updates a scheduled event to be an external event that will take place in Brazil and end in 2025
|
|
1822
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1823
|
-
* const event = await client.guildScheduledEvent.editGuildScheduledEvent(guildId, eventId, { entity_type: 3, channel_id: null, entity_metadata: { location: "Brazil" }, scheduled_end_time: "2025-01-01T00:00:00.000Z" })
|
|
1824
|
-
*/
|
|
1825
|
-
editGuildScheduledEvent(guildId: string, eventId: string, data: RESTPatchAPIGuildScheduledEventJSONBody, reason?: string): Promise<RESTPatchAPIGuildScheduledEventResult>;
|
|
1826
|
-
/**
|
|
1827
|
-
* Delete a specific scheduled event for a guild
|
|
1828
|
-
* @since 0.3.6
|
|
1829
|
-
* @param guildId The Id of the guild
|
|
1830
|
-
* @param eventId The Id of the event
|
|
1831
|
-
* @returns Resolves the promise on successful execution
|
|
1832
|
-
*
|
|
1833
|
-
* | Permissions needed | Condition |
|
|
1834
|
-
* |--------------------|----------------------------------|
|
|
1835
|
-
* | MANAGE_EVENTS | always |
|
|
1836
|
-
* | MANAGE_CHANNELS | If entity_type is STAGE_INSTANCE |
|
|
1837
|
-
* | MUTE_MEMBERS | If entity_type is STAGE_INSTANCE |
|
|
1838
|
-
* | MOVE_MEMBERS | If entity_type is STAGE_INSTANCE |
|
|
1839
|
-
* | VIEW_CHANNEL | If entity_type is VOICE |
|
|
1840
|
-
* | CONNECT | If entity_type is VOICE |
|
|
1841
|
-
*
|
|
1842
|
-
* @example
|
|
1843
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1844
|
-
* client.guildScheduledEvent.deleteGuildScheduledEvent(guildId, eventId)
|
|
1845
|
-
*/
|
|
1846
|
-
deleteGuildScheduledEvent(guildId: string, eventId: string): Promise<void>;
|
|
1847
|
-
/**
|
|
1848
|
-
* Get a list of users attending a specific event
|
|
1849
|
-
* @since 0.3.6
|
|
1850
|
-
* @param guildId The Id of the guild
|
|
1851
|
-
* @param eventId The Id of the event
|
|
1852
|
-
* @param options Options for how to get users
|
|
1853
|
-
* @returns An array of [event users](https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure)
|
|
1854
|
-
*
|
|
1855
|
-
* | Permissions needed | Condition |
|
|
1856
|
-
* |--------------------|-------------------------------------------|
|
|
1857
|
-
* | VIEW_CHANNEL | if entity_type is STAGE_INSTANCE or VOICE |
|
|
1858
|
-
*
|
|
1859
|
-
* @example
|
|
1860
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1861
|
-
* const users = await client.guildScheduledEvent.getGuildScheduledEventUsers(guildId, eventId)
|
|
1862
|
-
*/
|
|
1863
|
-
getGuildScheduledEventUsers(guildId: string, eventId: string, options?: RESTGetAPIGuildScheduledEventUsersQuery): Promise<RESTGetAPIGuildScheduledEventUsersResult>;
|
|
1864
|
-
}
|
|
1865
|
-
|
|
1866
|
-
/**
|
|
1867
|
-
* Methods for interacting with Guild Templates
|
|
1868
|
-
* @since 0.3.0
|
|
1869
|
-
* @protected
|
|
1870
|
-
*/
|
|
1871
|
-
declare class GuildTemplateMethods {
|
|
1872
|
-
readonly requestHandler: RequestHandler;
|
|
1873
|
-
/**
|
|
1874
|
-
* Create a new Guild Template Method Handler
|
|
1875
|
-
*
|
|
1876
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
1877
|
-
*
|
|
1878
|
-
* You can access the methods listed via `client.guildTemplate.method`, where `client` is an initialized SnowTransfer instance
|
|
1879
|
-
* @param requestHandler request handler that calls the rest api
|
|
1880
|
-
*/
|
|
1881
|
-
constructor(requestHandler: RequestHandler);
|
|
1882
|
-
/**
|
|
1883
|
-
* Get a guild template by code
|
|
1884
|
-
* @since 0.3.0
|
|
1885
|
-
* @param code The code for the template
|
|
1886
|
-
* @returns A [guild template](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
1887
|
-
*
|
|
1888
|
-
* @example
|
|
1889
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1890
|
-
* const template = await client.guildTemplate.getGuildTemplate("code")
|
|
1891
|
-
*/
|
|
1892
|
-
getGuildTemplate(code: string): Promise<RESTGetAPITemplateResult>;
|
|
1893
|
-
/**
|
|
1894
|
-
* Gets all templates from a guild
|
|
1895
|
-
* @since 0.3.0
|
|
1896
|
-
* @param guildId The Id of the guild
|
|
1897
|
-
* @returns An array of [guild templates](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
1898
|
-
*
|
|
1899
|
-
* | Permissions needed | Condition |
|
|
1900
|
-
* |--------------------|-----------|
|
|
1901
|
-
* | MANAGE_GUILD | always |
|
|
1902
|
-
*
|
|
1903
|
-
* @example
|
|
1904
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1905
|
-
* const templates = await client.guildTemplate.getGuildTemplates("guildId")
|
|
1906
|
-
*/
|
|
1907
|
-
getGuildTemplates(guildId: string): Promise<RESTGetAPIGuildTemplatesResult>;
|
|
1908
|
-
/**
|
|
1909
|
-
* Creates a template from the current state of the guild
|
|
1910
|
-
* @since 0.3.0
|
|
1911
|
-
* @param guildId The Id of the guild
|
|
1912
|
-
* @param data Metadata for the template
|
|
1913
|
-
* @returns A [guild tempalte](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
1914
|
-
*
|
|
1915
|
-
* | Permissions needed | Condition |
|
|
1916
|
-
* |--------------------|-----------|
|
|
1917
|
-
* | MANAGE_GUILD | always |
|
|
1918
|
-
*
|
|
1919
|
-
* @example
|
|
1920
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1921
|
-
* const template = await client.guildTemplate.createGuildTemplate("guildId", { name: "Cool guild template", description: "This is a cool guild template" })
|
|
1922
|
-
*/
|
|
1923
|
-
createGuildTemplate(guildId: string, data: RESTPostAPIGuildTemplatesJSONBody): Promise<RESTPostAPIGuildTemplatesResult>;
|
|
1924
|
-
/**
|
|
1925
|
-
* Updates a guild template to match the current state of the guild
|
|
1926
|
-
* @since 0.3.0
|
|
1927
|
-
* @param guildId The Id of the guild
|
|
1928
|
-
* @param code The code of the template
|
|
1929
|
-
* @returns A [guild template](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
1930
|
-
*
|
|
1931
|
-
* | Permissions needed | Condition |
|
|
1932
|
-
* |--------------------|-----------|
|
|
1933
|
-
* | MANAGE_GUILD | always |
|
|
1934
|
-
*
|
|
1935
|
-
* @example
|
|
1936
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1937
|
-
* const template = await client.guildTemplate.syncGuildTemplate("guildId", "code")
|
|
1938
|
-
*/
|
|
1939
|
-
syncGuildTemplate(guildId: string, code: string): Promise<RESTPutAPIGuildTemplateSyncResult>;
|
|
1940
|
-
/**
|
|
1941
|
-
* Updates a guild template's metadata
|
|
1942
|
-
* @since 0.3.0
|
|
1943
|
-
* @param guildId The Id of the guild
|
|
1944
|
-
* @param code The code of the template
|
|
1945
|
-
* @param data Metadata for the template
|
|
1946
|
-
* @returns A [guild template](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
1947
|
-
*
|
|
1948
|
-
* | Permissions needed | Condition |
|
|
1949
|
-
* |--------------------|-----------|
|
|
1950
|
-
* | MANAGE_GUILD | always |
|
|
1951
|
-
*
|
|
1952
|
-
* @example
|
|
1953
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1954
|
-
* const template = await client.guildTemplate.modifyGuildTemplate("guildId", "code", { name: "Coolest guild template", description: "This is the coolest guild template hands down" })
|
|
1955
|
-
*/
|
|
1956
|
-
modifyGuildTemplate(guildId: string, code: string, data: RESTPatchAPIGuildTemplateJSONBody): Promise<RESTPatchAPIGuildTemplateResult>;
|
|
1957
|
-
/**
|
|
1958
|
-
* Deletes a template from a guild
|
|
1959
|
-
* @since 0.3.0
|
|
1960
|
-
* @param guildId The Id of the guild
|
|
1961
|
-
* @param code The code of the template
|
|
1962
|
-
* @returns A [guild template](https://discord.com/developers/docs/resources/guild-template#guild-template-object-guild-template-structure)
|
|
1963
|
-
*
|
|
1964
|
-
* | Permissions needed | Condition |
|
|
1965
|
-
* |--------------------|-----------|
|
|
1966
|
-
* | MANAGE_GUILD | always |
|
|
1967
|
-
*
|
|
1968
|
-
* @example
|
|
1969
|
-
* const client = new SnowTransfer("TOKEN")
|
|
1970
|
-
* const template = await client.guildTemplate.deleteGuildTemplate("guildId", "code")
|
|
1971
|
-
*/
|
|
1972
|
-
deleteGuildTemplate(guildId: string, code: string): Promise<RESTDeleteAPIGuildTemplateResult>;
|
|
1973
|
-
}
|
|
1974
|
-
|
|
1975
|
-
/**
|
|
1976
|
-
* Methods for handling webhook interactions
|
|
1977
|
-
* @since 0.1.0
|
|
1978
|
-
* @protected
|
|
1979
|
-
*/
|
|
1980
|
-
declare class WebhookMethods {
|
|
1981
|
-
readonly requestHandler: RequestHandler;
|
|
1982
|
-
options: SnowTransfer.Options;
|
|
1983
|
-
/**
|
|
1984
|
-
* Create a new Method Handler
|
|
1985
|
-
*
|
|
1986
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
1987
|
-
*
|
|
1988
|
-
* You can access the methods listed via `client.webhook.method`, where `client` is an initialized SnowTransfer instance
|
|
1989
|
-
* @param requestHandler request handler that calls the rest api
|
|
1990
|
-
* @param options Options for the SnowTransfer instance
|
|
1991
|
-
*/
|
|
1992
|
-
constructor(requestHandler: RequestHandler, options: SnowTransfer.Options);
|
|
1993
|
-
/**
|
|
1994
|
-
* Create a new Webhook
|
|
1995
|
-
* @since 0.1.0
|
|
1996
|
-
* @param channelId Id of the channel
|
|
1997
|
-
* @param data Object with webhook properties
|
|
1998
|
-
* @param reason Reason for creating the webhook
|
|
1999
|
-
* @returns [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
2000
|
-
*
|
|
2001
|
-
* | Permissions needed | Condition |
|
|
2002
|
-
* |--------------------|-----------|
|
|
2003
|
-
* | MANAGE_WEBHOOKS | always |
|
|
2004
|
-
*
|
|
2005
|
-
* @example
|
|
2006
|
-
* // Create a new Webhook with the name "Webby Webhook"
|
|
2007
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2008
|
-
* const webhookData = {
|
|
2009
|
-
* name: "Webby Webhook"
|
|
2010
|
-
* }
|
|
2011
|
-
* const webhook = await client.webhook.createWebhook("channel Id", webhookData)
|
|
2012
|
-
*/
|
|
2013
|
-
createWebhook(channelId: string, data: RESTPostAPIChannelWebhookJSONBody, reason?: string): Promise<RESTPostAPIChannelWebhookResult>;
|
|
2014
|
-
/**
|
|
2015
|
-
* Get all webhooks within a channel
|
|
2016
|
-
* @since 0.5.0
|
|
2017
|
-
* @param channelId Id of the channel
|
|
2018
|
-
* @returns Array of [Webhook Objects](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
2019
|
-
*
|
|
2020
|
-
* | Permissions needed | Condition |
|
|
2021
|
-
* |--------------------|-----------|
|
|
2022
|
-
* | MANAGE_WEBHOOKS | always |
|
|
2023
|
-
*
|
|
2024
|
-
* @example
|
|
2025
|
-
* // Get all webhooks within a channel
|
|
2026
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2027
|
-
* const webhooks = await client.webhook.getChannelWebhooks("channel Id")
|
|
2028
|
-
*/
|
|
2029
|
-
getChannelWebhooks(channelId: string): Promise<RESTGetAPIChannelWebhooksResult>;
|
|
2030
|
-
/**
|
|
2031
|
-
* Get all webhooks within a guild
|
|
2032
|
-
* @since 0.5.0
|
|
2033
|
-
* @param guildId Id of the guild
|
|
2034
|
-
* @returns Array of [Webhook Objects](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
2035
|
-
*
|
|
2036
|
-
* | Permissions needed | Condition |
|
|
2037
|
-
* |--------------------|-----------|
|
|
2038
|
-
* | MANAGE_WEBHOOKS | always |
|
|
2039
|
-
*
|
|
2040
|
-
* @example
|
|
2041
|
-
* // Get all webhooks within a guild
|
|
2042
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2043
|
-
* const webhooks = await client.webhook.getGuildWebhooks("guild Id")
|
|
2044
|
-
*/
|
|
2045
|
-
getGuildWebhooks(guildId: string): Promise<RESTGetAPIGuildWebhooksResult>;
|
|
2046
|
-
/**
|
|
2047
|
-
* Get a single Webhook via Id
|
|
2048
|
-
* @since 0.1.0
|
|
2049
|
-
* @param webhookId Id of the webhook
|
|
2050
|
-
* @param token Webhook token
|
|
2051
|
-
* @returns [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
2052
|
-
*
|
|
2053
|
-
* | Permissions needed | Condition |
|
|
2054
|
-
* |--------------------|---------------|
|
|
2055
|
-
* | MANAGE_WEBHOOKS | without token |
|
|
2056
|
-
*
|
|
2057
|
-
* @example
|
|
2058
|
-
* // Get a webhook via Id providing a webhook token
|
|
2059
|
-
* const client = new SnowTransfer() // No token needed if webhook token is provided
|
|
2060
|
-
* const webhook = await client.webhook.getWebhook("webhook Id", "webhook token")
|
|
2061
|
-
*/
|
|
2062
|
-
getWebhook(webhookId: string, token?: string): Promise<RESTGetAPIWebhookResult>;
|
|
2063
|
-
/**
|
|
2064
|
-
* Update a webhook without a token
|
|
2065
|
-
* @since 0.1.0
|
|
2066
|
-
* @param webhookId Id of the webhook
|
|
2067
|
-
* @param data Updated Webhook properties
|
|
2068
|
-
* @param reason Reason for updating the webhook
|
|
2069
|
-
* @returns Updated [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
2070
|
-
*
|
|
2071
|
-
* | Permissions needed | Condition |
|
|
2072
|
-
* |--------------------|-----------|
|
|
2073
|
-
* | MANAGE_WEBHOOKS | always |
|
|
2074
|
-
*
|
|
2075
|
-
* @example
|
|
2076
|
-
* // Rename a webhook to "Captain Hook" without a webhook token
|
|
2077
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2078
|
-
* const webhookData = {
|
|
2079
|
-
* name: "Captain Hook"
|
|
2080
|
-
* }
|
|
2081
|
-
* const webhook = await client.webhook.updateWebhook("webhook Id", webhookData)
|
|
2082
|
-
*/
|
|
2083
|
-
updateWebhook(webhookId: string, data: RESTPatchAPIWebhookJSONBody, reason?: string): Promise<RESTPatchAPIWebhookResult>;
|
|
2084
|
-
/**
|
|
2085
|
-
* Update a webhook with a token
|
|
2086
|
-
* @since 0.17.0
|
|
2087
|
-
* @param webhookId Id of the webhook
|
|
2088
|
-
* @param token Token of the webhook
|
|
2089
|
-
* @param data Updated webhook properties
|
|
2090
|
-
* @param reason Reason for updating the webhook
|
|
2091
|
-
* @returns Updated [Webhook Object](https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure)
|
|
2092
|
-
*
|
|
2093
|
-
* @example
|
|
2094
|
-
* // Rename a webhook to "Captain Hook" with a webhook token
|
|
2095
|
-
* const client = new SnowTransfer() // No token needed if webhook token is provided
|
|
2096
|
-
* const webhookData = {
|
|
2097
|
-
* name: "Captain Hook"
|
|
2098
|
-
* }
|
|
2099
|
-
* const webhook = await client.webhook.updateWebhook("webhook Id", "webhook token" webhookData)
|
|
2100
|
-
*/
|
|
2101
|
-
updateWebhookToken(webhookId: string, token: string, data: RESTPatchAPIWebhookWithTokenJSONBody, reason?: string): Promise<RESTPatchAPIWebhookWithTokenResult>;
|
|
2102
|
-
/**
|
|
2103
|
-
* Delete a Webhook
|
|
2104
|
-
* @since 0.1.0
|
|
2105
|
-
* @param webhookId Id of the webhook
|
|
2106
|
-
* @param reason Reason for deleting the webhook
|
|
2107
|
-
* @returns Resolves the Promise on successful execution
|
|
2108
|
-
*
|
|
2109
|
-
* | Permissions needed | Condition |
|
|
2110
|
-
* |--------------------|-----------|
|
|
2111
|
-
* | MANAGE_WEBHOOKS | always |
|
|
2112
|
-
*
|
|
2113
|
-
* @example
|
|
2114
|
-
* // Delete a webhook via Id without a webhook token
|
|
2115
|
-
* const client = new SnowTransfer("TOKEN");
|
|
2116
|
-
* client.webhook.deleteWebhook("webhook Id")
|
|
2117
|
-
*/
|
|
2118
|
-
deleteWebhook(webhookId: string, reason?: string): Promise<void>;
|
|
2119
|
-
/**
|
|
2120
|
-
* Delete a Webhook with a token
|
|
2121
|
-
* @since 0.17.0
|
|
2122
|
-
* @param webhookId Id of the webhook
|
|
2123
|
-
* @param token Webhook token
|
|
2124
|
-
* @returns Resolves the Promise on successful execution
|
|
2125
|
-
*
|
|
2126
|
-
* @example
|
|
2127
|
-
* // Delete a webhook via Id providing a webhook token
|
|
2128
|
-
* const client = new SnowTransfer(); // No token needed if webhook token is provided
|
|
2129
|
-
* client.webhook.deleteWebhookToken("webhook Id", "webhook token")
|
|
2130
|
-
*/
|
|
2131
|
-
deleteWebhookToken(webhookId: string, token: string, reason?: string): Promise<void>;
|
|
2132
|
-
/**
|
|
2133
|
-
* Send a message via Webhook
|
|
2134
|
-
* @since 0.1.0
|
|
2135
|
-
* @param webhookId Id of the webhook
|
|
2136
|
-
* @param token webhook token
|
|
2137
|
-
* @param data Webhook data to send
|
|
2138
|
-
* @param options Options for executing the webhook
|
|
2139
|
-
* @returns Resolves the Promise on successful execution unless wait is set to true, which returns a [message]() object
|
|
2140
|
-
*
|
|
2141
|
-
* @example
|
|
2142
|
-
* // Send a message saying "Hi from my webhook" with a previously created webhook
|
|
2143
|
-
* const client = new SnowTransfer()
|
|
2144
|
-
* client.webhook.executeWebhook("webhook Id", "webhook token", { content: "Hi from my webhook" })
|
|
2145
|
-
*/
|
|
2146
|
-
executeWebhook(webhookId: string, token: string, data: RESTPostAPIWebhookWithTokenJSONBody & {
|
|
2147
|
-
files?: Array<{
|
|
2148
|
-
name: string;
|
|
2149
|
-
file: Buffer | Readable | ReadableStream;
|
|
2150
|
-
}>;
|
|
2151
|
-
}, options?: RESTPostAPIWebhookWithTokenQuery & {
|
|
2152
|
-
wait?: false;
|
|
2153
|
-
disableEveryone?: boolean;
|
|
2154
|
-
}): Promise<RESTPostAPIWebhookWithTokenResult>;
|
|
2155
|
-
executeWebhook(webhookId: string, token: string, data: RESTPostAPIWebhookWithTokenJSONBody & {
|
|
2156
|
-
files?: Array<{
|
|
2157
|
-
name: string;
|
|
2158
|
-
file: Buffer | Readable | ReadableStream;
|
|
2159
|
-
}>;
|
|
2160
|
-
}, options: RESTPostAPIWebhookWithTokenQuery & {
|
|
2161
|
-
wait: true;
|
|
2162
|
-
disableEveryone?: boolean;
|
|
2163
|
-
}): Promise<RESTPostAPIWebhookWithTokenWaitResult>;
|
|
2164
|
-
/**
|
|
2165
|
-
* Execute a slack style Webhook
|
|
2166
|
-
* @since 0.1.0
|
|
2167
|
-
* @param webhookId Id of the Webhook
|
|
2168
|
-
* @param token Webhook token
|
|
2169
|
-
* @param data Check [Slack's documentation](https://api.slack.com/incoming-webhooks)
|
|
2170
|
-
* @param options Options for executing the webhook
|
|
2171
|
-
* @returns Resolves the Promise on successful execution
|
|
2172
|
-
*
|
|
2173
|
-
* @example
|
|
2174
|
-
* const client = new SnowTransfer() // No token needed
|
|
2175
|
-
* client.webhook.executeSlackWebhook("webhook Id", "webhook token", slackdata)
|
|
2176
|
-
*/
|
|
2177
|
-
executeWebhookSlack(webhookId: string, token: string, data: any, options?: RESTPostAPIWebhookWithTokenSlackQuery & {
|
|
2178
|
-
wait?: false;
|
|
2179
|
-
}): Promise<RESTPostAPIWebhookWithTokenSlackResult>;
|
|
2180
|
-
executeWebhookSlack(webhookId: string, token: string, data: any, options?: RESTPostAPIWebhookWithTokenSlackQuery & {
|
|
2181
|
-
wait: true;
|
|
2182
|
-
}): Promise<RESTPostAPIWebhookWithTokenSlackWaitResult>;
|
|
2183
|
-
/**
|
|
2184
|
-
* Executes a github style Webhook
|
|
2185
|
-
* @since 0.3.0
|
|
2186
|
-
* @param webhookId Id of the Webhook
|
|
2187
|
-
* @param token Webhook token
|
|
2188
|
-
* @param data Check [GitHub's documentation](https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#webhook-payload-object)
|
|
2189
|
-
* @param options Options for executing the webhook
|
|
2190
|
-
* @returns Resolves the Promise on successful execution
|
|
2191
|
-
*/
|
|
2192
|
-
executeWebhookGitHub(webhookId: string, token: string, data: any, options?: RESTPostAPIWebhookWithTokenGitHubQuery & {
|
|
2193
|
-
wait?: false;
|
|
2194
|
-
}): Promise<RESTPostAPIWebhookWithTokenGitHubResult>;
|
|
2195
|
-
executeWebhookGitHub(webhookId: string, token: string, data: any, options?: RESTPostAPIWebhookWithTokenGitHubQuery & {
|
|
2196
|
-
wait: true;
|
|
2197
|
-
}): Promise<RESTPostAPIWebhookWithTokenGitHubWaitResult>;
|
|
2198
|
-
/**
|
|
2199
|
-
* Get a single message from a specific Webhook via Id
|
|
2200
|
-
* @since 0.3.0
|
|
2201
|
-
* @param webhookId Id of the Webhook
|
|
2202
|
-
* @param token Webhook token
|
|
2203
|
-
* @param messageId Id of the message
|
|
2204
|
-
* @param threadId Id of the thread the message was sent in
|
|
2205
|
-
* @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
2206
|
-
*/
|
|
2207
|
-
getWebhookMessage(webhookId: string, token: string, messageId: string, threadId?: string): Promise<RESTGetAPIWebhookWithTokenMessageResult>;
|
|
2208
|
-
/**
|
|
2209
|
-
* Edit a message sent by a Webhook
|
|
2210
|
-
* @since 0.3.0
|
|
2211
|
-
* @param webhookId Id of the Webhook
|
|
2212
|
-
* @param token Webhook token
|
|
2213
|
-
* @param messageId Id of the message
|
|
2214
|
-
* @param data Data to send
|
|
2215
|
-
* @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
2216
|
-
*
|
|
2217
|
-
* @example
|
|
2218
|
-
* const client = new SnowTransfer()
|
|
2219
|
-
* const message = await client.webhook.editWebhookMessage("webhook Id", "webhook token", "message Id", { content: "New content" })
|
|
2220
|
-
*/
|
|
2221
|
-
editWebhookMessage(webhookId: string, token: string, messageId: string, data: RESTPatchAPIWebhookWithTokenMessageJSONBody & {
|
|
2222
|
-
thread_id?: string;
|
|
2223
|
-
files?: Array<{
|
|
2224
|
-
name: string;
|
|
2225
|
-
file: Buffer | Readable | ReadableStream;
|
|
2226
|
-
}>;
|
|
2227
|
-
}): Promise<RESTPatchAPIWebhookWithTokenMessageResult>;
|
|
2228
|
-
/**
|
|
2229
|
-
* Delete a message sent by a Webhook
|
|
2230
|
-
* @since 0.3.0
|
|
2231
|
-
* @param webhookId Id of the Webhook
|
|
2232
|
-
* @param token Webhook token
|
|
2233
|
-
* @param messageId Id of the message
|
|
2234
|
-
* @param threadId Id of the thread the message was sent in
|
|
2235
|
-
* @returns Resolves the Promise on successful execution
|
|
2236
|
-
*/
|
|
2237
|
-
deleteWebhookMessage(webhookId: string, token: string, messageId: string, threadId?: string): Promise<void>;
|
|
2238
|
-
}
|
|
2239
|
-
|
|
2240
|
-
/**
|
|
2241
|
-
* Methods for interacting with slash command specific endpoints
|
|
2242
|
-
* @since 0.3.0
|
|
2243
|
-
* @protected
|
|
2244
|
-
*/
|
|
2245
|
-
declare class InteractionMethods {
|
|
2246
|
-
readonly requestHandler: RequestHandler;
|
|
2247
|
-
readonly webhooks: WebhookMethods;
|
|
2248
|
-
options: SnowTransfer.Options;
|
|
2249
|
-
/**
|
|
2250
|
-
* Create a new Interaction Method Handler
|
|
2251
|
-
*
|
|
2252
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
2253
|
-
*
|
|
2254
|
-
* You can access the methods listed via `client.interaction.method`, where `client` is an initialized SnowTransfer instance
|
|
2255
|
-
* @param requestHandler request handler that calls the rest api
|
|
2256
|
-
* @param webhooks WebhookMethods class that handles webhook related stuff
|
|
2257
|
-
*/
|
|
2258
|
-
constructor(requestHandler: RequestHandler, webhooks: WebhookMethods, options: SnowTransfer.Options);
|
|
2259
|
-
/**
|
|
2260
|
-
* Fetch all global commands for your application
|
|
2261
|
-
* @since 0.3.0
|
|
2262
|
-
* @param appId The Id of the application
|
|
2263
|
-
* @param withLocalizations Whether or not to include localizations
|
|
2264
|
-
* @returns An Array of [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) objects
|
|
2265
|
-
*
|
|
2266
|
-
* @example
|
|
2267
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2268
|
-
* const commands = await client.interaction.getApplicationCommands("appId")
|
|
2269
|
-
*/
|
|
2270
|
-
getApplicationCommands(appId: string, withLocalizations?: boolean): Promise<RESTGetAPIApplicationCommandsResult>;
|
|
2271
|
-
/**
|
|
2272
|
-
* Create a new global command. New global commands will be available in all guilds after 1 hour
|
|
2273
|
-
* @since 0.3.0
|
|
2274
|
-
* @param appId The Id of the application
|
|
2275
|
-
* @param data The command data
|
|
2276
|
-
* @returns An [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) object
|
|
2277
|
-
*
|
|
2278
|
-
* @example
|
|
2279
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2280
|
-
* const command = await client.interaction.createApplicationCommand("appId", { name: "test", description: "testing 1, 2, 3" })
|
|
2281
|
-
*/
|
|
2282
|
-
createApplicationCommand(appId: string, data: RESTPostAPIApplicationCommandsJSONBody): Promise<RESTPostAPIApplicationCommandsResult>;
|
|
2283
|
-
/**
|
|
2284
|
-
* Fetch a global command for your application
|
|
2285
|
-
* @since 0.3.0
|
|
2286
|
-
* @param appId The Id of the application
|
|
2287
|
-
* @param cmdId The Id of the command
|
|
2288
|
-
* @returns An [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) object
|
|
2289
|
-
*
|
|
2290
|
-
* @example
|
|
2291
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2292
|
-
* const command = await client.interaction.getApplicationCommand("appId", "cmdId")
|
|
2293
|
-
*/
|
|
2294
|
-
getApplicationCommand(appId: string, cmdId: string): Promise<RESTGetAPIApplicationCommandResult>;
|
|
2295
|
-
/**
|
|
2296
|
-
* Edit a global command. Updates will be available in all guilds after 1 hour
|
|
2297
|
-
* @since 0.3.0
|
|
2298
|
-
* @param appId The Id of the application
|
|
2299
|
-
* @param cmdId The Id of the command
|
|
2300
|
-
* @param data The command data
|
|
2301
|
-
* @returns An [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) object
|
|
2302
|
-
*
|
|
2303
|
-
* @example
|
|
2304
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2305
|
-
* const command = await client.interaction.editApplicationCommand("appId", "cmdId", { name: "cool", description: "tells you how cool you are" })
|
|
2306
|
-
*/
|
|
2307
|
-
editApplicationCommand(appId: string, cmdId: string, data: RESTPatchAPIApplicationCommandJSONBody): Promise<RESTPatchAPIApplicationCommandResult>;
|
|
2308
|
-
/**
|
|
2309
|
-
* Deletes a global command
|
|
2310
|
-
* @since 0.3.0
|
|
2311
|
-
* @param appId The Id of the application
|
|
2312
|
-
* @param cmdId The Id of the command
|
|
2313
|
-
* @returns Resolves the Promise on successful execution
|
|
2314
|
-
*
|
|
2315
|
-
* @example
|
|
2316
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2317
|
-
* client.interaction.deleteApplicationCommand("appId", "cmdId")
|
|
2318
|
-
*/
|
|
2319
|
-
deleteApplicationCommand(appId: string, cmdId: string): Promise<void>;
|
|
2320
|
-
/**
|
|
2321
|
-
* Takes a list of application commands, overwriting existing commands that are registered globally for this application.
|
|
2322
|
-
* Updates will be available in all guilds after 1 hour
|
|
2323
|
-
* @since 0.3.0
|
|
2324
|
-
* @param appId The Id of the application
|
|
2325
|
-
* @param data Array of commands
|
|
2326
|
-
* @returns An Array of [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) objects
|
|
2327
|
-
*
|
|
2328
|
-
* @example
|
|
2329
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2330
|
-
* const commands = await client.interaction.bulkOverwriteApplicationCommands("appId", [{ name: "test", description: "testing 1, 2, 3" }])
|
|
2331
|
-
*/
|
|
2332
|
-
bulkOverwriteApplicationCommands(appId: string, data: RESTPutAPIApplicationCommandsJSONBody): Promise<RESTPutAPIApplicationCommandsResult>;
|
|
2333
|
-
/**
|
|
2334
|
-
* Fetch all of the guild commands for your application for a specific guild.
|
|
2335
|
-
* @since 0.3.0
|
|
2336
|
-
* @param appId The Id of the application
|
|
2337
|
-
* @param guildId The Id of the guild
|
|
2338
|
-
* @param withLocalizations Whether or not to include localizations
|
|
2339
|
-
* @returns An Array of [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) objects
|
|
2340
|
-
*
|
|
2341
|
-
* @example
|
|
2342
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2343
|
-
* const commands = await client.interaction.getGuildCommands("appId", "guildId", true)
|
|
2344
|
-
*/
|
|
2345
|
-
getGuildApplicationCommands(appId: string, guildId: string, withLocalizations?: boolean): Promise<RESTGetAPIApplicationGuildCommandsResult>;
|
|
2346
|
-
/**
|
|
2347
|
-
* Create a new guild command. New guild commands will be available in the guild immediately.
|
|
2348
|
-
* @since 0.3.0
|
|
2349
|
-
* @param appId The Id of the application
|
|
2350
|
-
* @param guildId The Id of the guild
|
|
2351
|
-
* @param data Command data
|
|
2352
|
-
* @returns An [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) object
|
|
2353
|
-
*
|
|
2354
|
-
* @example
|
|
2355
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2356
|
-
* const command = await client.interaction.createGuildApplicationCommand("appId", "guildId", { name: "test", description: "testing 1, 2, 3" })
|
|
2357
|
-
*/
|
|
2358
|
-
createGuildApplicationCommand(appId: string, guildId: string, data: RESTPostAPIApplicationGuildCommandsJSONBody): Promise<RESTPostAPIApplicationGuildCommandsResult>;
|
|
2359
|
-
/**
|
|
2360
|
-
* Fetch a guild command for your application
|
|
2361
|
-
* @since 0.3.0
|
|
2362
|
-
* @param appId The Id of the application
|
|
2363
|
-
* @param guildId The Id of the guild
|
|
2364
|
-
* @param cmdId The Id of the command
|
|
2365
|
-
* @returns An [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) object
|
|
2366
|
-
*
|
|
2367
|
-
* @example
|
|
2368
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2369
|
-
* const command = await client.interaction.getGuildApplicationCommand("appId", "guildId", "cmdId")
|
|
2370
|
-
*/
|
|
2371
|
-
getGuildApplicationCommand(appId: string, guildId: string, cmdId: string): Promise<RESTGetAPIApplicationGuildCommandResult>;
|
|
2372
|
-
/**
|
|
2373
|
-
* Edit a guild command. Updates for guild commands will be available immediately.
|
|
2374
|
-
* @since 0.3.0
|
|
2375
|
-
* @param appId The Id of the application
|
|
2376
|
-
* @param guildId The Id of the guild
|
|
2377
|
-
* @param cmdId The Id of the command
|
|
2378
|
-
* @param data New command data
|
|
2379
|
-
* @returns An [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) object
|
|
2380
|
-
*
|
|
2381
|
-
* @example
|
|
2382
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2383
|
-
* const command = await client.interaction.editGuildApplicationCommand("appId", "guildId", "cmdId", { name: "coolest", description: "tells you that you are the coolest" })
|
|
2384
|
-
*/
|
|
2385
|
-
editGuildApplicationCommand(appId: string, guildId: string, cmdId: string, data: RESTPatchAPIApplicationGuildCommandJSONBody): Promise<RESTPatchAPIApplicationGuildCommandResult>;
|
|
2386
|
-
/**
|
|
2387
|
-
* Delete a guild command
|
|
2388
|
-
* @since 0.3.0
|
|
2389
|
-
* @param appId The Id of the application
|
|
2390
|
-
* @param guildId The Id of the guild
|
|
2391
|
-
* @param cmdId The Id of the command
|
|
2392
|
-
* @returns Resolves the Promise on successful execution
|
|
2393
|
-
*
|
|
2394
|
-
* @example
|
|
2395
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2396
|
-
* client.interaction.deleteGuildApplicationCommand("appId", "guildId", "cmdId")
|
|
2397
|
-
*/
|
|
2398
|
-
deleteGuildApplicationCommand(appId: string, guildId: string, cmdId: string): Promise<void>;
|
|
2399
|
-
/**
|
|
2400
|
-
* Takes a list of application commands, overwriting existing commands for the guild
|
|
2401
|
-
* @since 0.5.0
|
|
2402
|
-
* @param appId The Id of the application
|
|
2403
|
-
* @param guildId The Id of the guild
|
|
2404
|
-
* @param data Array of commands
|
|
2405
|
-
* @returns An Array of [application command](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure) objects
|
|
2406
|
-
*
|
|
2407
|
-
* @example
|
|
2408
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2409
|
-
* const commands = await client.interaction.bulkOverwriteGuildApplicationCommands("appId", "guildId", [{ name: "test", description: "testing 1, 2, 3" }])
|
|
2410
|
-
*/
|
|
2411
|
-
bulkOverwriteGuildApplicationCommands(appId: string, guildId: string, data: RESTPutAPIApplicationGuildCommandsJSONBody): Promise<RESTPutAPIApplicationGuildCommandsResult>;
|
|
2412
|
-
/**
|
|
2413
|
-
* Fetches command permissions for all or a specific command for your application in a guild
|
|
2414
|
-
* @since 0.3.0
|
|
2415
|
-
* @param appId The Id of the application
|
|
2416
|
-
* @param guildId The Id of the guild
|
|
2417
|
-
* @param cmdId The Id of the command
|
|
2418
|
-
* @returns An Array or single [guild application command permission](https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure) objects
|
|
2419
|
-
*
|
|
2420
|
-
* @example
|
|
2421
|
-
* // Gets all commands' permissions
|
|
2422
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2423
|
-
* const permissions = await client.interaction.getGuildApplicationCommandPermissions("appId", "guildId")
|
|
2424
|
-
*
|
|
2425
|
-
* @example
|
|
2426
|
-
* // Gets a specific command's permissions
|
|
2427
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2428
|
-
* const permissions = await client.interaction.getGuildApplicationCommandPermissions("appId", "guildId", "cmdId")
|
|
2429
|
-
*/
|
|
2430
|
-
getGuildApplicationCommandPermissions(appId: string, guildId: string): Promise<Array<RESTGetAPIApplicationCommandPermissionsResult>>;
|
|
2431
|
-
getGuildApplicationCommandPermissions(appId: string, guildId: string, cmdId: string): Promise<RESTGetAPIApplicationCommandPermissionsResult>;
|
|
2432
|
-
/**
|
|
2433
|
-
* Edits command permissions for a specific command for your application in a guild. You can only add up to 10 permission overwrites for a command.
|
|
2434
|
-
* @since 0.5.0
|
|
2435
|
-
* @param appId The Id of the application
|
|
2436
|
-
* @param guildId The Id of the guild
|
|
2437
|
-
* @param cmdId The Id of the command
|
|
2438
|
-
* @param permissions New application command permissions data
|
|
2439
|
-
* @returns A [guild application command permission](https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure) object
|
|
2440
|
-
*
|
|
2441
|
-
* @example
|
|
2442
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2443
|
-
* const permissions = await client.interaction.editGuildApplicationCommandPermissions("appId", "guildId", "cmdId", [{ type: 2, id: "userId", permission: true }])
|
|
2444
|
-
*/
|
|
2445
|
-
editGuildApplicationCommandPermissions(appId: string, guildId: string, cmdId: string, permissions: RESTPutAPIApplicationCommandPermissionsJSONBody["permissions"]): Promise<RESTPutAPIApplicationCommandPermissionsResult>;
|
|
2446
|
-
/**
|
|
2447
|
-
* Create a response to an Interaction
|
|
2448
|
-
*
|
|
2449
|
-
* When uploading attachments to respond to message interactions, you must provide the top level files property
|
|
2450
|
-
* which needs to match attachments array length and each element needs to match the same indexes as where their filename is defined (the top level files property gets deleted before it's appended to payload_json).
|
|
2451
|
-
* Should you have a more elegant solution, possibly rewriting the interface with the request handler, please submit a PR/issue.
|
|
2452
|
-
* @since 0.3.0
|
|
2453
|
-
* @param interactionId The Id of the interaction
|
|
2454
|
-
* @param token The token of the interaction
|
|
2455
|
-
* @param data Response data
|
|
2456
|
-
* @returns Resolves the Promise on successful execution
|
|
2457
|
-
*
|
|
2458
|
-
* @example
|
|
2459
|
-
* // Respond to a message interaction
|
|
2460
|
-
* const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
|
|
2461
|
-
* client.interaction.createInteractionResponse("interactionId", "token", { type: 4, data: { content: "Hello World" } })
|
|
2462
|
-
*/
|
|
2463
|
-
createInteractionResponse(interactionId: string, token: string, data: RESTPostAPIInteractionCallbackJSONBody & {
|
|
2464
|
-
files?: Array<{
|
|
2465
|
-
name: string;
|
|
2466
|
-
file: Buffer | Readable | ReadableStream;
|
|
2467
|
-
}>;
|
|
2468
|
-
}): Promise<void>;
|
|
2469
|
-
/**
|
|
2470
|
-
* Returns the initial Interaction response
|
|
2471
|
-
* @since 0.3.0
|
|
2472
|
-
* @param appId The Id of the application
|
|
2473
|
-
* @param token The token of the interaction
|
|
2474
|
-
* @returns A [message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
2475
|
-
*
|
|
2476
|
-
* @example
|
|
2477
|
-
* const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
|
|
2478
|
-
* const message = await client.interaction.getOriginalInteractionResponse("appId", "token")
|
|
2479
|
-
*/
|
|
2480
|
-
getOriginalInteractionResponse(appId: string, token: string): Promise<RESTGetAPIInteractionOriginalResponseResult>;
|
|
2481
|
-
/**
|
|
2482
|
-
* Edits the initial Interaction response
|
|
2483
|
-
* @since 0.3.0
|
|
2484
|
-
* @param appId The Id of the application
|
|
2485
|
-
* @param token The token of the interaction
|
|
2486
|
-
* @param data New response data
|
|
2487
|
-
* @returns A [message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
2488
|
-
*
|
|
2489
|
-
* @example
|
|
2490
|
-
* const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
|
|
2491
|
-
* const message = await client.interaction.editOriginalInteractionResponse("appId", "token", { content: "The world said hello back" })
|
|
2492
|
-
*/
|
|
2493
|
-
editOriginalInteractionResponse(appId: string, token: string, data: RESTPatchAPIInteractionOriginalResponseJSONBody & {
|
|
2494
|
-
files?: Array<{
|
|
2495
|
-
name: string;
|
|
2496
|
-
file: Buffer | Readable | ReadableStream;
|
|
2497
|
-
}>;
|
|
2498
|
-
}): Promise<RESTPatchAPIInteractionOriginalResponseResult>;
|
|
2499
|
-
/**
|
|
2500
|
-
* Deletes the initial Interaction response
|
|
2501
|
-
* @since 0.3.0
|
|
2502
|
-
* @param appId The Id of the application
|
|
2503
|
-
* @param token The token of the interaction
|
|
2504
|
-
* @returns Resolves the Promise on successful execution
|
|
2505
|
-
*
|
|
2506
|
-
* @example
|
|
2507
|
-
* const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
|
|
2508
|
-
* client.interaction.deleteOriginalInteractionResponse("appId", "token")
|
|
2509
|
-
*/
|
|
2510
|
-
deleteOriginalInteractionResponse(appId: string, token: string): Promise<void>;
|
|
2511
|
-
/**
|
|
2512
|
-
* Create a followup message for an Interaction
|
|
2513
|
-
* @since 0.3.0
|
|
2514
|
-
* @param appId The Id of the application
|
|
2515
|
-
* @param token The token of the interaction
|
|
2516
|
-
* @param data Message data
|
|
2517
|
-
* @returns A [message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
2518
|
-
*
|
|
2519
|
-
* @example
|
|
2520
|
-
* const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
|
|
2521
|
-
* const message = await client.interaction.createFollowupMessage("appId", "token", { content: "The pacer gram fitness test-" })
|
|
2522
|
-
*/
|
|
2523
|
-
createFollowupMessage(appId: string, token: string, data: RESTPostAPIInteractionFollowupJSONBody & {
|
|
2524
|
-
files?: Array<{
|
|
2525
|
-
name: string;
|
|
2526
|
-
file: Buffer | Readable | ReadableStream;
|
|
2527
|
-
}>;
|
|
2528
|
-
}): Promise<RESTPostAPIInteractionFollowupResult>;
|
|
2529
|
-
/**
|
|
2530
|
-
* Get a followup message for an Interaction
|
|
2531
|
-
* @since 0.3.0
|
|
2532
|
-
* @param appId The Id of the application
|
|
2533
|
-
* @param token The token of the interaction
|
|
2534
|
-
* @param messageId The Id of the message
|
|
2535
|
-
* @returns A [message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
2536
|
-
*
|
|
2537
|
-
* @example
|
|
2538
|
-
* const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
|
|
2539
|
-
* const message = await client.interaction.getFollowupMessage("appId", "token", "messageId")
|
|
2540
|
-
*/
|
|
2541
|
-
getFollowupMessage(appId: string, token: string, messageId: string): Promise<RESTGetAPIInteractionFollowupResult>;
|
|
2542
|
-
/**
|
|
2543
|
-
* Edits a followup message for an Interaction
|
|
2544
|
-
* @since 0.3.0
|
|
2545
|
-
* @param appId The Id of the application
|
|
2546
|
-
* @param token The token of the interaction
|
|
2547
|
-
* @param messageId The Id of the message
|
|
2548
|
-
* @param data The new message data
|
|
2549
|
-
* @returns A [message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
2550
|
-
*
|
|
2551
|
-
* @example
|
|
2552
|
-
* const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
|
|
2553
|
-
* const message = await client.interaction.editFollowupMessage("appId", "token", "messageId", { content: "-is a multistage aerobic capacity test" })
|
|
2554
|
-
*/
|
|
2555
|
-
editFollowupMessage(appId: string, token: string, messageId: string, data: RESTPatchAPIInteractionFollowupJSONBody & {
|
|
2556
|
-
files?: Array<{
|
|
2557
|
-
name: string;
|
|
2558
|
-
file: Buffer | Readable | ReadableStream;
|
|
2559
|
-
}>;
|
|
2560
|
-
}): Promise<RESTPatchAPIInteractionFollowupResult>;
|
|
2561
|
-
/**
|
|
2562
|
-
* Deletes a followup message for an Interaction
|
|
2563
|
-
* @since 0.3.0
|
|
2564
|
-
* @param appId The Id of the application
|
|
2565
|
-
* @param token The token of the interaction
|
|
2566
|
-
* @param messageId The Id of the message
|
|
2567
|
-
* @returns Resolves the Promise on successful execution
|
|
2568
|
-
*
|
|
2569
|
-
* @example
|
|
2570
|
-
* const client = new SnowTransfer() // This endpoint does not require a Bot token. The interaction token alone will suffice
|
|
2571
|
-
* client.interaction.deleteFollowupMessage("appId", "token", "messageId")
|
|
2572
|
-
*/
|
|
2573
|
-
deleteFollowupMessage(appId: string, token: string, messageId: string): Promise<void>;
|
|
2574
|
-
}
|
|
2575
|
-
|
|
2576
|
-
/**
|
|
2577
|
-
* Methods for interacting with invites
|
|
2578
|
-
* @since 0.1.0
|
|
2579
|
-
* @protected
|
|
2580
|
-
*/
|
|
2581
|
-
declare class InviteMethods {
|
|
2582
|
-
readonly requestHandler: RequestHandler;
|
|
2583
|
-
/**
|
|
2584
|
-
* Create a new Invite Method Handler
|
|
2585
|
-
*
|
|
2586
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
2587
|
-
*
|
|
2588
|
-
* You can access the methods listed via `client.invite.method`, where `client` is an initialized SnowTransfer instance
|
|
2589
|
-
* @param requestHandler request handler that calls the rest api
|
|
2590
|
-
*/
|
|
2591
|
-
constructor(requestHandler: RequestHandler);
|
|
2592
|
-
/**
|
|
2593
|
-
* Get the invite data on an invite id
|
|
2594
|
-
* @since 0.1.0
|
|
2595
|
-
* @param inviteId Id of the invite
|
|
2596
|
-
* @param options Query params for additional metadata fields
|
|
2597
|
-
* @returns [Invite Object](https://discord.com/developers/docs/resources/invite#invite-object)
|
|
2598
|
-
*
|
|
2599
|
-
* @example
|
|
2600
|
-
* // Gets an invite with approximate_member_count and approximate_presence_count
|
|
2601
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2602
|
-
* const invite = await client.invite.getInvite("inviteId", { with_counts: true })
|
|
2603
|
-
*/
|
|
2604
|
-
getInvite(inviteId: string, options?: RESTGetAPIInviteQuery): Promise<RESTGetAPIInviteResult>;
|
|
2605
|
-
/**
|
|
2606
|
-
* Delete an invite
|
|
2607
|
-
* @since 0.1.0
|
|
2608
|
-
* @param inviteId Id of the invite
|
|
2609
|
-
* @param reason Reason for deleting the invite
|
|
2610
|
-
* @returns [Invite Object](https://discord.com/developers/docs/resources/invite#invite-object)
|
|
2611
|
-
*
|
|
2612
|
-
* | Permissions needed | Condition |
|
|
2613
|
-
* |--------------------|-----------------------------------------------|
|
|
2614
|
-
* | MANAGE_CHANNELS | for invite that belongs to a specific channel |
|
|
2615
|
-
* | MANAGE_GUILD | delete any invite guild wide |
|
|
2616
|
-
*
|
|
2617
|
-
* @example
|
|
2618
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2619
|
-
* const invite = await client.invite.deleteInvite("inviteId")
|
|
2620
|
-
*/
|
|
2621
|
-
deleteInvite(inviteId: string, reason?: string): Promise<RESTDeleteAPIInviteResult>;
|
|
2622
|
-
/**
|
|
2623
|
-
* Gets the users allowed to see and accept an invite
|
|
2624
|
-
* @since 0.17.0
|
|
2625
|
-
* @param inviteId Id of the invite
|
|
2626
|
-
* @returns An Array of user IDs
|
|
2627
|
-
*
|
|
2628
|
-
* @example
|
|
2629
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2630
|
-
* const userIds = await client.invite.getInviteTargetUsers("inviteId")
|
|
2631
|
-
*/
|
|
2632
|
-
getInviteTargetUsers(inviteId: string): Promise<RESTGetAPIInviteTargetUsers>;
|
|
2633
|
-
/**
|
|
2634
|
-
* Updates the users allowed to see and accept an invite
|
|
2635
|
-
* @since 0.17.0
|
|
2636
|
-
* @param inviteId Id of the invite
|
|
2637
|
-
* @returns Resolves the Promise on successful execution
|
|
2638
|
-
*
|
|
2639
|
-
* @example
|
|
2640
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2641
|
-
* await client.invite.updateInviteTargetUsers("inviteId", someUserArray)
|
|
2642
|
-
*/
|
|
2643
|
-
updateInviteTargetUsers(inviteId: string, userIds: Array<string>): Promise<void>;
|
|
2644
|
-
/**
|
|
2645
|
-
* Gets the job status on setting target users to an invite
|
|
2646
|
-
* @param inviteId Id of the invite
|
|
2647
|
-
* @returns [Target Users Job Status Object](https://discord.com/developers/docs/resources/invite#get-target-users-job-status-example-response)
|
|
2648
|
-
*
|
|
2649
|
-
* @example
|
|
2650
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2651
|
-
* const jobStatus = await client.invite.getInviteTargetUsersJobStatus("inviteId")
|
|
2652
|
-
*/
|
|
2653
|
-
getInviteTargetUsersJobStatus(inviteId: string): Promise<RESTGetAPIInviteTargetUsersJobStatus>;
|
|
2654
|
-
}
|
|
2655
|
-
|
|
2656
|
-
/**
|
|
2657
|
-
* Methods for interacting with SKUs
|
|
2658
|
-
* @since 0.13.0
|
|
2659
|
-
* @protected
|
|
2660
|
-
*/
|
|
2661
|
-
declare class SkuMethods {
|
|
2662
|
-
readonly requestHandler: RequestHandler;
|
|
2663
|
-
/**
|
|
2664
|
-
* Create a new SKU Method handler
|
|
2665
|
-
*
|
|
2666
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
2667
|
-
*
|
|
2668
|
-
* You can access the methods listed via `client.subscription.method` where `client` is an initialized SnowTransfer instance
|
|
2669
|
-
* @param requestHandler request handler that calls the rest api
|
|
2670
|
-
*/
|
|
2671
|
-
constructor(requestHandler: RequestHandler);
|
|
2672
|
-
/**
|
|
2673
|
-
* Returns all SKUs for a given application.
|
|
2674
|
-
* @since 0.13.0
|
|
2675
|
-
* @param appId Id of the app
|
|
2676
|
-
* @returns Array of [SKU objects](https://discord.com/developers/docs/resources/sku#sku-object)
|
|
2677
|
-
*
|
|
2678
|
-
* @example
|
|
2679
|
-
* // Get all SKUs for an app
|
|
2680
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2681
|
-
* const skus = await client.sku.GetSkus("app id")
|
|
2682
|
-
*/
|
|
2683
|
-
GetSkus(appId: string): Promise<RESTGetAPISKUsResult>;
|
|
2684
|
-
/**
|
|
2685
|
-
* Returns all subscriptions containing the SKU, filtered by user.
|
|
2686
|
-
* @since 0.13.0
|
|
2687
|
-
* @param skuId Id of the SKU
|
|
2688
|
-
* @param options Query data (required with at least `user_id` unless using an OAuth token)
|
|
2689
|
-
* @returns Array of [subscription objects](https://discord.com/developers/docs/resources/subscription#subscription-object)
|
|
2690
|
-
*
|
|
2691
|
-
* @example
|
|
2692
|
-
* // Get all subscriptions for a user
|
|
2693
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2694
|
-
* const filter = { user_id: "user id" }
|
|
2695
|
-
* const subscriptions = await client.sku.getSubscriptions("sku id", filter)
|
|
2696
|
-
*/
|
|
2697
|
-
getSubscriptions(skuId: string, options?: RESTGetAPISKUSubscriptionsQuery): Promise<RESTGetAPISKUSubscriptionsResult>;
|
|
2698
|
-
/**
|
|
2699
|
-
* Get a subscription by its ID.
|
|
2700
|
-
* @since 0.13.0
|
|
2701
|
-
* @param skuId Id of the SKU
|
|
2702
|
-
* @param subscriptionId Id of the subscription
|
|
2703
|
-
* @returns A [subscription object](https://discord.com/developers/docs/resources/subscription#subscription-object)
|
|
2704
|
-
*
|
|
2705
|
-
* @example
|
|
2706
|
-
* // Get a subscription for a SKU by Id
|
|
2707
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2708
|
-
* const subscription = await client.sku.getSubscription("sku id", "subscription id")
|
|
2709
|
-
*/
|
|
2710
|
-
getSubscription(skuId: string, subscriptionId: string): Promise<RESTGetAPISKUSubscriptionResult>;
|
|
2711
|
-
}
|
|
2712
|
-
|
|
2713
|
-
/**
|
|
2714
|
-
* Methods for interacting with Stage instances
|
|
2715
|
-
* @since 0.3.0
|
|
2716
|
-
* @protected
|
|
2717
|
-
*/
|
|
2718
|
-
declare class StageInstanceMethods {
|
|
2719
|
-
readonly requestHandler: RequestHandler;
|
|
2720
|
-
/**
|
|
2721
|
-
* Create a new Stage Instance Method Handler
|
|
2722
|
-
*
|
|
2723
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
2724
|
-
*
|
|
2725
|
-
* You can access the methods listed via `client.stageInstance.method`, where `client` is an initialized SnowTransfer instance
|
|
2726
|
-
* @param requestHandler request handler that calls the rest api
|
|
2727
|
-
*/
|
|
2728
|
-
constructor(requestHandler: RequestHandler);
|
|
2729
|
-
/**
|
|
2730
|
-
* Creates a new stage instance associated to a stage channel
|
|
2731
|
-
* @since 0.3.0
|
|
2732
|
-
* @param data The options for creating a stage instance
|
|
2733
|
-
* @param reason Reason for creating the stage instance
|
|
2734
|
-
* @returns a [stage instance](https://discord.com/developers/docs/resources/stage-instance#auto-closing-stage-instance-structure) object
|
|
2735
|
-
*
|
|
2736
|
-
* | Permissions needed | Condition |
|
|
2737
|
-
* |--------------------|-----------|
|
|
2738
|
-
* | MANAGE_CHANNELS | always |
|
|
2739
|
-
* | MUTE_MEMBERS | always |
|
|
2740
|
-
* | MOVE_MEMBERS | always |
|
|
2741
|
-
*
|
|
2742
|
-
* @example
|
|
2743
|
-
* // Create a new stage instance for channel id and the topic "This My House"
|
|
2744
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2745
|
-
* const instance = await client.stageInstance.createStageInstance({ channel_id: "channel id", topic: "This My House" })
|
|
2746
|
-
*/
|
|
2747
|
-
createStageInstance(data: RESTPostAPIStageInstanceJSONBody, reason?: string): Promise<RESTPostAPIStageInstanceResult>;
|
|
2748
|
-
/**
|
|
2749
|
-
* Gets the stage instance associated to a stage channel if it exists
|
|
2750
|
-
* @since 0.3.0
|
|
2751
|
-
* @param channelId Id of the stage channel
|
|
2752
|
-
* @returns a [stage instance](https://discord.com/developers/docs/resources/stage-instance#auto-closing-stage-instance-structure) object
|
|
2753
|
-
*
|
|
2754
|
-
* @example
|
|
2755
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2756
|
-
* const instance = await client.stageInstance.getStageInstance("channel id")
|
|
2757
|
-
*/
|
|
2758
|
-
getStageInstance(channelId: string): Promise<RESTGetAPIStageInstanceResult>;
|
|
2759
|
-
/**
|
|
2760
|
-
* Updates an existing stage instance
|
|
2761
|
-
* @since 0.3.0
|
|
2762
|
-
* @param channelId Id of the stage channel
|
|
2763
|
-
* @param data The new data to send
|
|
2764
|
-
* @param reason Reason for editing the stage instance
|
|
2765
|
-
* @returns a [stage instance](https://discord.com/developers/docs/resources/stage-instance#auto-closing-stage-instance-structure) object
|
|
2766
|
-
*
|
|
2767
|
-
* | Permissions needed | Condition |
|
|
2768
|
-
* |--------------------|-----------|
|
|
2769
|
-
* | MANAGE_CHANNELS | always |
|
|
2770
|
-
* | MUTE_MEMBERS | always |
|
|
2771
|
-
* | MOVE_MEMBERS | always |
|
|
2772
|
-
*
|
|
2773
|
-
* @example
|
|
2774
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2775
|
-
* const instance = await client.stageInstance.updateStageInstance("channel id", { topic: "This my city, this my town" })
|
|
2776
|
-
*/
|
|
2777
|
-
editStageInstance(channelId: string, data: RESTPatchAPIStageInstanceJSONBody, reason?: string): Promise<RESTPatchAPIStageInstanceResult>;
|
|
2778
|
-
/**
|
|
2779
|
-
* Delete an existing stage instance
|
|
2780
|
-
* @since 0.3.0
|
|
2781
|
-
* @param channelId Id of the stage channel
|
|
2782
|
-
* @param reason Reason for deleting the stage instance
|
|
2783
|
-
* @returns a [stage instance](https://discord.com/developers/docs/resources/stage-instance#auto-closing-stage-instance-structure) object
|
|
2784
|
-
*
|
|
2785
|
-
* | Permissions needed | Condition |
|
|
2786
|
-
* |--------------------|-----------|
|
|
2787
|
-
* | MANAGE_CHANNELS | always |
|
|
2788
|
-
* | MUTE_MEMBERS | always |
|
|
2789
|
-
* | MOVE_MEMBERS | always |
|
|
2790
|
-
*
|
|
2791
|
-
* @example
|
|
2792
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2793
|
-
* client.stageInstance.deleteStageInstance("channel id", "They already know who's house this is")
|
|
2794
|
-
*/
|
|
2795
|
-
deleteStageInstance(channelId: string, reason?: string): Promise<void>;
|
|
2796
|
-
}
|
|
2797
|
-
|
|
2798
|
-
/**
|
|
2799
|
-
* Methods for interacting with users
|
|
2800
|
-
* @since 0.1.0
|
|
2801
|
-
* @protected
|
|
2802
|
-
*/
|
|
2803
|
-
declare class UserMethods {
|
|
2804
|
-
readonly requestHandler: RequestHandler;
|
|
2805
|
-
/**
|
|
2806
|
-
* Create a new User Method handler
|
|
2807
|
-
*
|
|
2808
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
2809
|
-
*
|
|
2810
|
-
* You can access the methods listed via `client.user.method`, where `client` is an initialized SnowTransfer instance
|
|
2811
|
-
* @param requestHandler
|
|
2812
|
-
*/
|
|
2813
|
-
constructor(requestHandler: RequestHandler);
|
|
2814
|
-
/**
|
|
2815
|
-
* Get information about the CurrentUser
|
|
2816
|
-
* @since 0.1.0
|
|
2817
|
-
* @returns A [user object](https://discord.com/developers/docs/resources/user#user-object)
|
|
2818
|
-
*
|
|
2819
|
-
* | OAUTH2 Scopes | Condition |
|
|
2820
|
-
* |---------------|---------------|
|
|
2821
|
-
* | identify | Without email |
|
|
2822
|
-
* | email | With email |
|
|
2823
|
-
*
|
|
2824
|
-
* @example
|
|
2825
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2826
|
-
* const self = await client.user.getSelf()
|
|
2827
|
-
*/
|
|
2828
|
-
getSelf(): Promise<RESTGetAPICurrentUserResult>;
|
|
2829
|
-
/**
|
|
2830
|
-
* Get information about a user via Id
|
|
2831
|
-
* @since 0.1.0
|
|
2832
|
-
* @param userId Id of the user
|
|
2833
|
-
* @returns [user object](https://discord.com/developers/docs/resources/user#user-object)
|
|
2834
|
-
*
|
|
2835
|
-
* @example
|
|
2836
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2837
|
-
* const user = await client.user.getUser("userId")
|
|
2838
|
-
*/
|
|
2839
|
-
getUser(userId: string): Promise<RESTGetAPIUserResult>;
|
|
2840
|
-
/**
|
|
2841
|
-
* Update the current user
|
|
2842
|
-
* @since 0.1.0
|
|
2843
|
-
* @param data The new data of the CurrentUser
|
|
2844
|
-
* @returns [user object](https://discord.com/developers/docs/resources/user#user-object)
|
|
2845
|
-
*
|
|
2846
|
-
* @example
|
|
2847
|
-
* // update the avatar of the user
|
|
2848
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2849
|
-
* const fileData = fs.readFileSync("new_avatar.png") // You should probably use fs.promises.readFile, since it is asynchronous, synchronous methods may lag your bot.
|
|
2850
|
-
* const updateData = \{
|
|
2851
|
-
* avatar: `data:image/png;base64,${fileData.toString("base64")}` // base64 data url: data:mimetype;base64,base64String
|
|
2852
|
-
* \}
|
|
2853
|
-
* client.user.updateSelf(updateData)
|
|
2854
|
-
*/
|
|
2855
|
-
updateSelf(data: RESTPatchAPICurrentUserJSONBody): Promise<RESTPatchAPICurrentUserResult>;
|
|
2856
|
-
/**
|
|
2857
|
-
* Get guilds of the current user
|
|
2858
|
-
* @since 0.1.0
|
|
2859
|
-
* @param options Options for getting guilds
|
|
2860
|
-
* @returns Array of [partial guild objects](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
2861
|
-
*
|
|
2862
|
-
* @example
|
|
2863
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2864
|
-
* const guilds = await client.user.getGuilds()
|
|
2865
|
-
*/
|
|
2866
|
-
getGuilds(options?: RESTGetAPICurrentUserGuildsQuery): Promise<RESTGetAPICurrentUserGuildsResult>;
|
|
2867
|
-
/**
|
|
2868
|
-
* Leaves a guild
|
|
2869
|
-
* @since 0.1.0
|
|
2870
|
-
* @param guildId Id of the guild
|
|
2871
|
-
* @returns Resolves the Promise on successful execution
|
|
2872
|
-
*
|
|
2873
|
-
* @example
|
|
2874
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2875
|
-
* client.user.leaveGuild("guildId")
|
|
2876
|
-
*/
|
|
2877
|
-
leaveGuild(guildId: string): Promise<void>;
|
|
2878
|
-
/**
|
|
2879
|
-
* Create a direct message channel with another user
|
|
2880
|
-
*
|
|
2881
|
-
* **You can not create a dm with another bot**
|
|
2882
|
-
* @since 0.1.0
|
|
2883
|
-
* @param userId Id of the user to create the direct message channel with
|
|
2884
|
-
* @returns A [DM channel](https://discord.com/developers/docs/resources/channel#channel-object)
|
|
2885
|
-
*
|
|
2886
|
-
* @example
|
|
2887
|
-
* // Create a dm channel and send "hi" to it
|
|
2888
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2889
|
-
* const channel = await client.user.createDirectMessageChannel("other user id")
|
|
2890
|
-
* client.channel.createMessage(channel.id, "hi")
|
|
2891
|
-
*/
|
|
2892
|
-
createDirectMessageChannel(userId: string): Promise<RESTPostAPICurrentUserCreateDMChannelResult>;
|
|
2893
|
-
/**
|
|
2894
|
-
* Create a group direct message channel with other users
|
|
2895
|
-
* @since 0.7.0
|
|
2896
|
-
* @param data An object containing a list of access tokens with gdm.join and optionally, a nickname dictionary keyed by user IDs with strings as values
|
|
2897
|
-
* @returns A [DM channel](https://discord.com/developers/docs/resources/channel#channel-object)
|
|
2898
|
-
*
|
|
2899
|
-
* | OAUTH2 Scopes | Condition |
|
|
2900
|
-
* |---------------|----------------------|
|
|
2901
|
-
* | gdm.join | always for each user |
|
|
2902
|
-
*
|
|
2903
|
-
* @example
|
|
2904
|
-
* // Create a group dm channel and send "hi" to it
|
|
2905
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2906
|
-
* const channel = await client.user.createGroupDirectMessageChannel({ access_tokens: ["user 1 access token", "user 2 access token"], { "320067006521147393": "Brad", "128392910574977024": "Wolke" } })
|
|
2907
|
-
* client.channel.createMessage(channel.id, "hi")
|
|
2908
|
-
*/
|
|
2909
|
-
createGroupDirectMessageChannel(data: {
|
|
2910
|
-
access_tokens: Array<string>;
|
|
2911
|
-
nicks?: {
|
|
2912
|
-
[userId: string]: string;
|
|
2913
|
-
};
|
|
2914
|
-
}): Promise<RESTPostAPICurrentUserCreateDMChannelResult>;
|
|
2915
|
-
/**
|
|
2916
|
-
* Returns a list of connections for the current user
|
|
2917
|
-
* @since 0.7.0
|
|
2918
|
-
* @returns A list of [connections](https://discord.com/developers/docs/resources/user#connection-object)
|
|
2919
|
-
*
|
|
2920
|
-
* | OAUTH2 Scopes | Condition |
|
|
2921
|
-
* |---------------|-----------|
|
|
2922
|
-
* | connections | always |
|
|
2923
|
-
*
|
|
2924
|
-
* @example
|
|
2925
|
-
* // Get all user's connections
|
|
2926
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2927
|
-
* const connections = await client.user.getConnections()
|
|
2928
|
-
*/
|
|
2929
|
-
getConnections(): Promise<RESTGetAPICurrentUserConnectionsResult>;
|
|
2930
|
-
/**
|
|
2931
|
-
* Gets a role connection for the current user
|
|
2932
|
-
* @since 0.7.0
|
|
2933
|
-
* @param appId Id of the application
|
|
2934
|
-
* @returns An [Application role connection](https://discord.com/developers/docs/resources/user#application-role-connection-object)
|
|
2935
|
-
*
|
|
2936
|
-
* | OAUTH2 Scopes | Condition |
|
|
2937
|
-
* |------------------------|-----------|
|
|
2938
|
-
* | role_connections.write | always |
|
|
2939
|
-
*
|
|
2940
|
-
* @example
|
|
2941
|
-
* // Get a role connection for an app
|
|
2942
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2943
|
-
* const connection = await client.user.getApplicationRoleConnection("app id")
|
|
2944
|
-
*/
|
|
2945
|
-
getApplicationRoleConnection(appId: string): Promise<RESTGetAPICurrentUserApplicationRoleConnectionResult>;
|
|
2946
|
-
/**
|
|
2947
|
-
* Updates a role connection for the current user
|
|
2948
|
-
* @since 0.7.0
|
|
2949
|
-
* @param appId Id of the application
|
|
2950
|
-
* @returns An [Application role connection](https://discord.com/developers/docs/resources/user#application-role-connection-object)
|
|
2951
|
-
*
|
|
2952
|
-
* | OAUTH2 Scopes | Condition |
|
|
2953
|
-
* |------------------------|-----------|
|
|
2954
|
-
* | role_connections.write | always |
|
|
2955
|
-
*
|
|
2956
|
-
* @example
|
|
2957
|
-
* // Updates a role connection for an app
|
|
2958
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2959
|
-
* const connection = await client.user.updateApplicationRoleConnection("app id", { platform_name: "some platform", platform_username: "Cool user 22" })
|
|
2960
|
-
*/
|
|
2961
|
-
updateApplicationRoleConnection(appId: string, data: RESTPutAPICurrentUserApplicationRoleConnectionJSONBody): Promise<RESTPutAPICurrentUserApplicationRoleConnectionResult>;
|
|
2962
|
-
}
|
|
2963
|
-
|
|
2964
|
-
/**
|
|
2965
|
-
* Methods for interacting with some voice
|
|
2966
|
-
* @since 0.1.0
|
|
2967
|
-
* @protected
|
|
2968
|
-
*/
|
|
2969
|
-
declare class VoiceMethods {
|
|
2970
|
-
readonly requestHandler: RequestHandler;
|
|
2971
|
-
/**
|
|
2972
|
-
* Create a new Voice Method Handler
|
|
2973
|
-
*
|
|
2974
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
2975
|
-
*
|
|
2976
|
-
* You can access the methods listed via `client.voice.method`, where `client` is an initialized SnowTransfer instance
|
|
2977
|
-
* @param requestHandler request handler that calls the rest api
|
|
2978
|
-
*/
|
|
2979
|
-
constructor(requestHandler: RequestHandler);
|
|
2980
|
-
/**
|
|
2981
|
-
* Get currently available voice regions that can be used when creating servers
|
|
2982
|
-
* @since 0.1.0
|
|
2983
|
-
* @returns Array of [voice region](https://discord.com/developers/docs/resources/voice#voice-region-object) objects
|
|
2984
|
-
*
|
|
2985
|
-
* @example
|
|
2986
|
-
* const client = new SnowTransfer("TOKEN")
|
|
2987
|
-
* const regions = await client.voice.getVoiceRegions()
|
|
2988
|
-
*/
|
|
2989
|
-
getVoiceRegions(): Promise<RESTGetAPIVoiceRegionsResult>;
|
|
2990
|
-
/**
|
|
2991
|
-
* Get the CurrentUser's voice state for a guild
|
|
2992
|
-
* @since 0.10.6
|
|
2993
|
-
* @param guildId Id of the guild
|
|
2994
|
-
* @returns A [voice state](https://discord.com/developers/docs/resources/voice#voice-state-object) object
|
|
2995
|
-
*/
|
|
2996
|
-
getCurrentUserVoiceState(guildId: string): Promise<APIVoiceState>;
|
|
2997
|
-
/**
|
|
2998
|
-
* Get a user's voice state for a guild
|
|
2999
|
-
* @since 0.10.6
|
|
3000
|
-
* @param guildId Id of the guild
|
|
3001
|
-
* @param userId Id of the user
|
|
3002
|
-
* @returns A [voice state](https://discord.com/developers/docs/resources/voice#voice-state-object) object
|
|
3003
|
-
*/
|
|
3004
|
-
getUserVoiceState(guildId: string, userId: string): Promise<APIVoiceState>;
|
|
3005
|
-
}
|
|
3006
|
-
|
|
3007
|
-
declare namespace SnowTransfer {
|
|
3008
|
-
type Options = {
|
|
3009
|
-
/** The URL to start requests from. eg: https://discord.com */
|
|
3010
|
-
baseHost: string;
|
|
3011
|
-
/** The default allowed_mentions object to send when creating/updating messages */
|
|
3012
|
-
allowed_mentions: APIAllowedMentions | undefined;
|
|
3013
|
-
/** If rate limit buckets should be totally bypassed and functions are executed as fast as possible. Only use if you are 100% certain you wont run into issues or if you are proxying */
|
|
3014
|
-
bypassBuckets: boolean;
|
|
3015
|
-
/** If failed requests that can be retried should be retried, up to retryLimit times. */
|
|
3016
|
-
retryRequests: boolean;
|
|
3017
|
-
/** How many times requests should be retried if they fail and can be retried. */
|
|
3018
|
-
retryLimit: number;
|
|
3019
|
-
};
|
|
3020
|
-
}
|
|
3021
|
-
/**
|
|
3022
|
-
* @since 0.1.0
|
|
3023
|
-
* @protected
|
|
3024
|
-
*/
|
|
3025
|
-
declare class SnowTransfer {
|
|
3026
|
-
/** Options for this SnowTransfer instance */
|
|
3027
|
-
options: SnowTransfer.Options;
|
|
3028
|
-
/** The access token to use for requests. Can be a bot or bearer token */
|
|
3029
|
-
token: string | undefined;
|
|
3030
|
-
/** Methods related to channels */
|
|
3031
|
-
readonly channel: ChannelMethods;
|
|
3032
|
-
/** Helper to execute REST calls */
|
|
3033
|
-
readonly requestHandler: RequestHandler;
|
|
3034
|
-
/** Methods related to users */
|
|
3035
|
-
readonly user: UserMethods;
|
|
3036
|
-
/** Methods related to stickers and emojis */
|
|
3037
|
-
readonly assets: AssetsMethods;
|
|
3038
|
-
/** Methods related to webhooks */
|
|
3039
|
-
readonly webhook: WebhookMethods;
|
|
3040
|
-
/** Methods related to guilds */
|
|
3041
|
-
readonly guild: GuildMethods;
|
|
3042
|
-
/** Methods related to guild scheduled events */
|
|
3043
|
-
readonly guildScheduledEvent: GuildScheduledEventMethods;
|
|
3044
|
-
/** Methods related to guild templates */
|
|
3045
|
-
readonly guildTemplate: GuildTemplateMethods;
|
|
3046
|
-
/** Methods related to application commands/interactions */
|
|
3047
|
-
readonly interaction: InteractionMethods;
|
|
3048
|
-
/** Methods related to invites */
|
|
3049
|
-
readonly invite: InviteMethods;
|
|
3050
|
-
/** Methods related to voice regions */
|
|
3051
|
-
readonly voice: VoiceMethods;
|
|
3052
|
-
/** Methods related to getting gateway connect info */
|
|
3053
|
-
readonly bot: BotMethods;
|
|
3054
|
-
/** Methods related to guild audit logs */
|
|
3055
|
-
readonly auditLog: AuditLogMethods;
|
|
3056
|
-
/** Methods related to guild stage instances */
|
|
3057
|
-
readonly stageInstance: StageInstanceMethods;
|
|
3058
|
-
/** Methods related to guild auto mod */
|
|
3059
|
-
readonly autoMod: AutoModerationMethods;
|
|
3060
|
-
/** Methods related to entitlements */
|
|
3061
|
-
readonly entitlement: EntitlementMethods;
|
|
3062
|
-
/** Methods related to SKUs */
|
|
3063
|
-
readonly sku: SkuMethods;
|
|
3064
|
-
/** Ratelimiter used for handling the ratelimits imposed by the rest api */
|
|
3065
|
-
readonly ratelimiter: Ratelimiter;
|
|
3066
|
-
/**
|
|
3067
|
-
* Create a new Rest Client
|
|
3068
|
-
* @param token Discord Bot token to use
|
|
3069
|
-
* @param options options
|
|
3070
|
-
*/
|
|
3071
|
-
constructor(token?: string, options?: Partial<SnowTransfer.Options>);
|
|
3072
|
-
}
|
|
3073
|
-
|
|
3074
|
-
/**
|
|
3075
|
-
* Methods for interacting with Channels and Messages
|
|
3076
|
-
* @since 0.1.0
|
|
3077
|
-
* @protected
|
|
3078
|
-
*/
|
|
3079
|
-
declare class ChannelMethods {
|
|
3080
|
-
readonly requestHandler: RequestHandler;
|
|
3081
|
-
options: SnowTransfer.Options;
|
|
3082
|
-
/**
|
|
3083
|
-
* Create a new Channel Method handler
|
|
3084
|
-
*
|
|
3085
|
-
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
3086
|
-
*
|
|
3087
|
-
* You can access the methods listed via `client.channel.method`, where `client` is an initialized SnowTransfer instance
|
|
3088
|
-
* @param requestHandler request handler that calls the rest api
|
|
3089
|
-
* @param options Options for the SnowTransfer instance
|
|
3090
|
-
*/
|
|
3091
|
-
constructor(requestHandler: RequestHandler, options: SnowTransfer.Options);
|
|
3092
|
-
/**
|
|
3093
|
-
* Get a channel via Id
|
|
3094
|
-
* @since 0.1.0
|
|
3095
|
-
* @param channelId Id of the channel
|
|
3096
|
-
* @returns [discord channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
3097
|
-
*
|
|
3098
|
-
* @example
|
|
3099
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3100
|
-
* const channel = await client.channel.getChannel("channel id")
|
|
3101
|
-
*/
|
|
3102
|
-
getChannel(channelId: string): Promise<RESTGetAPIChannelResult>;
|
|
3103
|
-
/**
|
|
3104
|
-
* Update a guild channel or thread
|
|
3105
|
-
* @since 0.1.0
|
|
3106
|
-
* @param channelId Id of the guild channel
|
|
3107
|
-
* @param data Data to update the channel with
|
|
3108
|
-
* @param reason Reason for updating the channel
|
|
3109
|
-
* @returns [discord channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
3110
|
-
*
|
|
3111
|
-
* | Permissions needed | Condition |
|
|
3112
|
-
* |--------------------|-------------------------------------------------------------------------------------------------------------------------|
|
|
3113
|
-
* | MANAGE_CHANNELS | always |
|
|
3114
|
-
* | MANAGE_ROLES | If modifying permission overwrites |
|
|
3115
|
-
* | SEND_MESSAGES | When editing a Thread to change the name, archived, auto_archive_duration, rate_limit_per_user or locked fields |
|
|
3116
|
-
* | MANAGE_THREADS | When editing a Thread and not modifying the name, archived, auto_archive_duration, rate_limit_per_user or locked fields |
|
|
3117
|
-
*
|
|
3118
|
-
* @example
|
|
3119
|
-
* // This example updates a channel with the passed id to use "New Name" as its name and "Look at this cool topic" as the topic
|
|
3120
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3121
|
-
* const updateData = {
|
|
3122
|
-
* name: "New Name",
|
|
3123
|
-
* topic: "Look at this cool topic"
|
|
3124
|
-
* }
|
|
3125
|
-
* client.channel.updateChannel("channel id", updateData)
|
|
3126
|
-
*/
|
|
3127
|
-
updateChannel(channelId: string, data: Omit<RESTPatchAPIChannelJSONBody, "archived" | "auto_archive_duration" | "locked" | "invitable">, reason?: string): Promise<Exclude<RESTPatchAPIChannelResult, APIThreadChannel>>;
|
|
3128
|
-
updateChannel(channelId: string, data: Pick<RESTPatchAPIChannelJSONBody, "archived" | "auto_archive_duration" | "locked" | "name" | "rate_limit_per_user">, reason?: string): Promise<Extract<RESTPatchAPIChannelResult, APIThreadChannel>>;
|
|
3129
|
-
/**
|
|
3130
|
-
* Delete a channel or thread via Id
|
|
3131
|
-
*
|
|
3132
|
-
* This either **deletes** a Guild Channel/thread or **closes** a Direct Message Channel
|
|
3133
|
-
*
|
|
3134
|
-
* **Be careful with deleting Guild Channels as this cannot be undone!**
|
|
3135
|
-
*
|
|
3136
|
-
* When deleting a category, this does **not** delete the child channels of a category. They will just have their `parent_id` removed.
|
|
3137
|
-
*
|
|
3138
|
-
* For community guilds, the rules channel and the community updates channel cannot be deleted.
|
|
3139
|
-
* @since 0.1.0
|
|
3140
|
-
* @param channelId Id of the channel
|
|
3141
|
-
* @param reason Reason for deleting the channel
|
|
3142
|
-
* @returns [discord channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
3143
|
-
*
|
|
3144
|
-
* | Permissions needed | Condition |
|
|
3145
|
-
* |--------------------|--------------------------------|
|
|
3146
|
-
* | MANAGE_CHANNELS | if channel is not a DM channel |
|
|
3147
|
-
* | MANAGE_THREADS | if channel is a thread |
|
|
3148
|
-
*
|
|
3149
|
-
* @example
|
|
3150
|
-
* // Deletes a channel via id because it wasn't needed anymore
|
|
3151
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3152
|
-
* client.channel.deleteChannel("channel id", "No longer needed")
|
|
3153
|
-
*/
|
|
3154
|
-
deleteChannel(channelId: string, reason?: string): Promise<RESTDeleteAPIChannelResult>;
|
|
3155
|
-
/**
|
|
3156
|
-
* Get a list of messages from a channel
|
|
3157
|
-
* @since 0.1.0
|
|
3158
|
-
* @param channelId Id of the channel
|
|
3159
|
-
* @param options Options for getting channel messages
|
|
3160
|
-
* @returns Array of [discord message](https://discord.com/developers/docs/resources/channel#message-object) objects
|
|
3161
|
-
*
|
|
3162
|
-
* | Permissions needed | Condition |
|
|
3163
|
-
* |----------------------|----------------------------------------------------------------------------------|
|
|
3164
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3165
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel, unless you want the API to return an empty Array |
|
|
3166
|
-
*
|
|
3167
|
-
* @example
|
|
3168
|
-
* // Fetch the last 20 messages from a channel
|
|
3169
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3170
|
-
* const options = {
|
|
3171
|
-
* limit: 20
|
|
3172
|
-
* }
|
|
3173
|
-
* const messages = await client.channel.getChannelMessages("channel id", options)
|
|
3174
|
-
*/
|
|
3175
|
-
getChannelMessages(channelId: string, options?: RESTGetAPIChannelMessagesQuery): Promise<RESTGetAPIChannelMessagesResult>;
|
|
3176
|
-
/**
|
|
3177
|
-
* Get a single message via Id
|
|
3178
|
-
* @since 0.1.0
|
|
3179
|
-
* @param channelId Id of the channel
|
|
3180
|
-
* @param messageId Id of the message
|
|
3181
|
-
* @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
3182
|
-
*
|
|
3183
|
-
* | Permissions needed | Condition |
|
|
3184
|
-
* |----------------------|--------------------------------|
|
|
3185
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3186
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel |
|
|
3187
|
-
*
|
|
3188
|
-
* @example
|
|
3189
|
-
* // Get a single message from a channel via id
|
|
3190
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3191
|
-
* const message = await client.channel.getChannelMessage("channel id", "message id")
|
|
3192
|
-
*/
|
|
3193
|
-
getChannelMessage(channelId: string, messageId: string): Promise<RESTGetAPIChannelMessageResult>;
|
|
3194
|
-
/**
|
|
3195
|
-
* Creates a new Message within a channel or thread
|
|
3196
|
-
*
|
|
3197
|
-
* **Make sure to use a filename with a proper extension (e.g. png, jpeg, etc.) when you want to upload files**
|
|
3198
|
-
* @since 0.1.0
|
|
3199
|
-
* @param channelId Id of the Channel or thread to send a message to
|
|
3200
|
-
* @param data Data to send, if data is a string it will be used as the content of the message,
|
|
3201
|
-
* if data is not a string you should take a look at the properties below to know what you may send
|
|
3202
|
-
* @param options Options for sending this message
|
|
3203
|
-
* @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
3204
|
-
*
|
|
3205
|
-
* | Permissions needed | Condition |
|
|
3206
|
-
* |--------------------------|---------------------------------------------------------------|
|
|
3207
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3208
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel and message is a reply |
|
|
3209
|
-
* | SEND_MESSAGES | if channel is not a DM channel and if channel is not a thread |
|
|
3210
|
-
* | SEND_TTS_MESSAGES | if channel is not a DM channel and tts is set to true |
|
|
3211
|
-
* | SEND_MESSAGES_IN_THREADS | if channel is a thread |
|
|
3212
|
-
*
|
|
3213
|
-
* @example
|
|
3214
|
-
* // Make a bot say "hi" within a channel
|
|
3215
|
-
* // createMessage sends the passed data as content, when you give it a string
|
|
3216
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3217
|
-
* client.channel.createMessage("channel id", "hi")
|
|
3218
|
-
*
|
|
3219
|
-
* @example
|
|
3220
|
-
* // Send a rich embed object
|
|
3221
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3222
|
-
* const embedData = {
|
|
3223
|
-
* title: "This is a nice embed",
|
|
3224
|
-
* description: "But winter is so cold",
|
|
3225
|
-
* fields: [
|
|
3226
|
-
* { name: "Brr", value: "Insert snowflake emoji here" }
|
|
3227
|
-
* ]
|
|
3228
|
-
* }
|
|
3229
|
-
* client.channel.createMessage("channel id", { embeds: [embedData] })
|
|
3230
|
-
*
|
|
3231
|
-
* @example
|
|
3232
|
-
* // Send a file with a comment
|
|
3233
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3234
|
-
* // fileData will be a buffer with the data of the png image.
|
|
3235
|
-
* const fileData = fs.readFileSync("nice_picture.png") // You should probably use fs.promises.readFile, since it is asynchronous, synchronous methods block the thread.
|
|
3236
|
-
* client.channel.createMessage("channel id", { content: "This is a nice picture", files: [{ name: "Optional_Filename.png", file: fileData }] })
|
|
3237
|
-
*/
|
|
3238
|
-
createMessage(channelId: string, data: string | RESTPostAPIChannelMessageJSONBody & {
|
|
3239
|
-
files?: Array<{
|
|
3240
|
-
name: string;
|
|
3241
|
-
file: Buffer | Readable | ReadableStream;
|
|
3242
|
-
}>;
|
|
3243
|
-
}): Promise<RESTPostAPIChannelMessageResult>;
|
|
3244
|
-
/**
|
|
3245
|
-
* Creates a new voice Message within a channel or thread
|
|
3246
|
-
* @since 0.10.0
|
|
3247
|
-
* @param channelId Id of the Channel or thread to send a message to
|
|
3248
|
-
* @param data Buffer of the audio file to send. Tested file types are ogg, mp3, m4a, wav, flac. Other file types work, but some can only be embedded on mobile. Try it and see:tm:
|
|
3249
|
-
* @param audioDurationSeconds The duration of the audio file in seconds
|
|
3250
|
-
* @param waveform A preview of the entire voice message, with 1 byte per datapoint encoded in base64. Clients sample the recording at most once per 100 milliseconds, but will downsample so that no more than 256 datapoints are in the waveform. If you have no clue what you're doing, leave this as an empty string
|
|
3251
|
-
* @returns non editable [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
3252
|
-
*
|
|
3253
|
-
* | Permissions needed | Condition |
|
|
3254
|
-
* |--------------------------|---------------------------------------------------------------|
|
|
3255
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3256
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel and message is a reply |
|
|
3257
|
-
* | SEND_MESSAGES | if channel is not a DM channel and if channel is not a thread |
|
|
3258
|
-
* | SEND_MESSAGES_IN_THREADS | if channel is a thread |
|
|
3259
|
-
*
|
|
3260
|
-
* @example
|
|
3261
|
-
* // Send a voice message that has a duration of 6 seconds
|
|
3262
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3263
|
-
* // fileData will be a buffer with the data of the ogg audio
|
|
3264
|
-
* const fileData = fs.readFileSync("6-second-long-audio.ogg") // You should probably use fs.promises.readFile, since it is asynchronous, synchronous methods block the thread.
|
|
3265
|
-
* client.channel.createVoiceMessage("channel id", fileData, 6)
|
|
3266
|
-
*/
|
|
3267
|
-
createVoiceMessage(channelId: string, data: Buffer, audioDurationSeconds: number, waveform?: string): Promise<RESTPostAPIChannelMessageResult>;
|
|
3268
|
-
/**
|
|
3269
|
-
* Crosspost a message in a news channel to all following channels
|
|
3270
|
-
* @since 0.3.0
|
|
3271
|
-
* @param channelId Id of the news channel
|
|
3272
|
-
* @param messageId Id of the message
|
|
3273
|
-
* @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
3274
|
-
*
|
|
3275
|
-
* | Permissions needed | Condition |
|
|
3276
|
-
* |--------------------|------------------------------------------------|
|
|
3277
|
-
* | VIEW_CHANNEL | always |
|
|
3278
|
-
* | SEND_MESSAGES | if the message was sent by the current user |
|
|
3279
|
-
* | MANAGE_MESSAGES | if the message wasn't sent by the current user |
|
|
3280
|
-
*
|
|
3281
|
-
* @example
|
|
3282
|
-
* // Crosspost a message
|
|
3283
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3284
|
-
* client.channel.crosspostMessage("channel id", "message id")
|
|
3285
|
-
*/
|
|
3286
|
-
crosspostMessage(channelId: string, messageId: string): Promise<RESTPostAPIChannelMessageCrosspostResult>;
|
|
3287
|
-
/**
|
|
3288
|
-
* Adds a reaction to a message
|
|
3289
|
-
* @since 0.1.0
|
|
3290
|
-
* @param channelId Id of the channel
|
|
3291
|
-
* @param messageId Id of the message
|
|
3292
|
-
* @param emoji uri encoded reaction emoji to add
|
|
3293
|
-
* you may either use a discord emoji in the format `:emoji_name:emoji_id` or a unicode emoji,
|
|
3294
|
-
* which can be found [here](http://www.unicode.org/emoji/charts/full-emoji-list.html)
|
|
3295
|
-
* @returns Resolves the Promise on successful execution
|
|
3296
|
-
*
|
|
3297
|
-
* | Permissions needed | Condition |
|
|
3298
|
-
* |----------------------|------------------------------------------------------------------------------------|
|
|
3299
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3300
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel |
|
|
3301
|
-
* | ADD_REACTIONS | When no other user has reacted with the emoji used and channel is not a DM channel |
|
|
3302
|
-
*
|
|
3303
|
-
* @example
|
|
3304
|
-
* // This example uses a discord emoji
|
|
3305
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3306
|
-
* client.channel.createReaction("channel Id", "message Id", encodeURIComponent("awooo:322522663304036352"))
|
|
3307
|
-
*
|
|
3308
|
-
* @example
|
|
3309
|
-
* // using a utf-8 emoji
|
|
3310
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3311
|
-
* client.channel.createReaction("channel Id", "message Id", encodeURIComponent("😀"))
|
|
3312
|
-
*/
|
|
3313
|
-
createReaction(channelId: string, messageId: string, emoji: string): Promise<void>;
|
|
3314
|
-
/**
|
|
3315
|
-
* Delete a reaction added by the current user from a message
|
|
3316
|
-
* @since 0.1.0
|
|
3317
|
-
* @param channelId Id of the channel
|
|
3318
|
-
* @param messageId Id of the message
|
|
3319
|
-
* @param emoji reaction emoji
|
|
3320
|
-
* @returns Resolves the Promise on successful execution
|
|
3321
|
-
*
|
|
3322
|
-
* | Permission | Condition |
|
|
3323
|
-
* |----------------------|--------------------------------|
|
|
3324
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3325
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel |
|
|
3326
|
-
*
|
|
3327
|
-
* @example
|
|
3328
|
-
* // This example uses a discord emoji
|
|
3329
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3330
|
-
* client.channel.deleteReactionSelf("channel Id", "message Id", encodeURIComponent("awooo:322522663304036352"))
|
|
3331
|
-
*
|
|
3332
|
-
* @example
|
|
3333
|
-
* // using a utf-8 emoji
|
|
3334
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3335
|
-
* client.channel.deleteReactionSelf("channel Id", "message Id", encodeURIComponent("😀"))
|
|
3336
|
-
*/
|
|
3337
|
-
deleteReactionSelf(channelId: string, messageId: string, emoji: string): Promise<void>;
|
|
3338
|
-
/**
|
|
3339
|
-
* Delete a reaction from a message in a guild channel
|
|
3340
|
-
* @since 0.1.0
|
|
3341
|
-
* @param channelId Id of the guild channel
|
|
3342
|
-
* @param messageId Id of the message
|
|
3343
|
-
* @param emoji reaction emoji
|
|
3344
|
-
* @param userId Id of the user
|
|
3345
|
-
* @returns Resolves the Promise on successful execution
|
|
3346
|
-
*
|
|
3347
|
-
* | Permission | Condition |
|
|
3348
|
-
* |----------------------|-----------|
|
|
3349
|
-
* | MANAGE_MESSAGES | always |
|
|
3350
|
-
* | VIEW_CHANNEL | always |
|
|
3351
|
-
* | READ_MESSAGE_HISTORY | always |
|
|
3352
|
-
*
|
|
3353
|
-
* @example
|
|
3354
|
-
* // This example uses a discord emoji
|
|
3355
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3356
|
-
* client.channel.deleteReaction("channel Id", "message Id", encodeURIComponent("awooo:322522663304036352"), "user Id")
|
|
3357
|
-
*
|
|
3358
|
-
* @example
|
|
3359
|
-
* // using a utf-8 emoji
|
|
3360
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3361
|
-
* // If a user Id is not supplied, the emoji from that message will be removed for all users
|
|
3362
|
-
* client.channel.deleteReaction("channel Id", "message Id", encodeURIComponent("😀"))
|
|
3363
|
-
*/
|
|
3364
|
-
deleteReaction(channelId: string, messageId: string, emoji: string, userId?: string): Promise<void>;
|
|
3365
|
-
/**
|
|
3366
|
-
* Get a list of users that reacted with a certain emoji on a certain message
|
|
3367
|
-
* @since 0.1.0
|
|
3368
|
-
* @param channelId Id of the channel
|
|
3369
|
-
* @param messageId Id of the message
|
|
3370
|
-
* @param emoji reaction emoji
|
|
3371
|
-
* @param options Options for getting users
|
|
3372
|
-
* @returns Array of [user objects](https://discord.com/developers/docs/resources/user#user-object)
|
|
3373
|
-
*
|
|
3374
|
-
* | Permissions needed | Condition |
|
|
3375
|
-
* |----------------------|--------------------------------|
|
|
3376
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3377
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel |
|
|
3378
|
-
*
|
|
3379
|
-
* @example
|
|
3380
|
-
* // This example uses a discord emoji
|
|
3381
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3382
|
-
* const reactions = await client.channel.getReactions("channel Id", "message Id", encodeURIComponent("awooo:322522663304036352"))
|
|
3383
|
-
*/
|
|
3384
|
-
getReactions(channelId: string, messageId: string, emoji: string, options?: RESTGetAPIChannelMessageReactionUsersQuery): Promise<RESTGetAPIChannelMessageReactionUsersResult>;
|
|
3385
|
-
/**
|
|
3386
|
-
* Delete all reactions from a message in a guild channel
|
|
3387
|
-
* @since 0.1.0
|
|
3388
|
-
* @param channelId Id of the guild channel
|
|
3389
|
-
* @param messageId Id of the message
|
|
3390
|
-
* @returns Resolves the Promise on successful execution
|
|
3391
|
-
*
|
|
3392
|
-
* | Permissions needed | Condition |
|
|
3393
|
-
* |----------------------|-----------|
|
|
3394
|
-
* | VIEW_CHANNEL | always |
|
|
3395
|
-
* | READ_MESSAGE_HISTORY | always |
|
|
3396
|
-
* | MANAGE_MESSAGES | always |
|
|
3397
|
-
*
|
|
3398
|
-
* @example
|
|
3399
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3400
|
-
* client.channel.deleteAllReactions("channel Id", "message Id")
|
|
3401
|
-
*/
|
|
3402
|
-
deleteAllReactions(channelId: string, messageId: string): Promise<void>;
|
|
3403
|
-
/**
|
|
3404
|
-
* Edit a message sent by the current user or edit the message flags of another user's message
|
|
3405
|
-
* @since 0.1.0
|
|
3406
|
-
* @param channelId Id of the channel
|
|
3407
|
-
* @param messageId Id of the message
|
|
3408
|
-
* @param data Data to send
|
|
3409
|
-
* @param options Options for editing this message
|
|
3410
|
-
* @returns [discord message](https://discord.com/developers/docs/resources/channel#message-object) object
|
|
3411
|
-
*
|
|
3412
|
-
* | Permissions needed | Condition |
|
|
3413
|
-
* |--------------------|--------------------------------------------------|
|
|
3414
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3415
|
-
* | MANAGE_MESSAGES | When editing someone else's message to set flags |
|
|
3416
|
-
*
|
|
3417
|
-
* @example
|
|
3418
|
-
* // Simple ping response
|
|
3419
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3420
|
-
* const time = Date.now()
|
|
3421
|
-
* const message = await client.channel.createMessage("channel id", "pong")
|
|
3422
|
-
* client.channel.editMessage("channel id", message.id, `pong ${Date.now() - time}ms`)
|
|
3423
|
-
*/
|
|
3424
|
-
editMessage(channelId: string, messageId: string, data: string | RESTPatchAPIChannelMessageJSONBody & {
|
|
3425
|
-
files?: Array<{
|
|
3426
|
-
name: string;
|
|
3427
|
-
file: Buffer | Readable | ReadableStream;
|
|
3428
|
-
}>;
|
|
3429
|
-
}): Promise<RESTPatchAPIChannelMessageResult>;
|
|
3430
|
-
/**
|
|
3431
|
-
* Delete a message
|
|
3432
|
-
* @since 0.1.0
|
|
3433
|
-
* @param channelId Id of the channel
|
|
3434
|
-
* @param messageId Id of the message
|
|
3435
|
-
* @param reason Reason for deleting the message
|
|
3436
|
-
* @returns Resolves the Promise on successful execution
|
|
3437
|
-
*
|
|
3438
|
-
* | Permissions needed | Condition |
|
|
3439
|
-
* |--------------------|----------------------------------------------|
|
|
3440
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3441
|
-
* | MANAGE_MESSAGES | When the bot isn't the author of the message |
|
|
3442
|
-
*
|
|
3443
|
-
* @example
|
|
3444
|
-
* // Delete a message
|
|
3445
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3446
|
-
* client.channel.deleteMessage("channel id", "message id")
|
|
3447
|
-
*/
|
|
3448
|
-
deleteMessage(channelId: string, messageId: string, reason?: string): Promise<void>;
|
|
3449
|
-
/**
|
|
3450
|
-
* Bulk delete messages from a guild channel, messages may not be older than 2 weeks
|
|
3451
|
-
* @since 0.1.0
|
|
3452
|
-
* @param channelId Id of the guild channel
|
|
3453
|
-
* @param messages array of message ids to delete
|
|
3454
|
-
* @param reason Reason for deleting the messages
|
|
3455
|
-
* @returns Resolves the Promise on successful execution
|
|
3456
|
-
*
|
|
3457
|
-
* | Permissions needed | Condition |
|
|
3458
|
-
* |--------------------|-----------|
|
|
3459
|
-
* | VIEW_CHANNEL | always |
|
|
3460
|
-
* | MANAGE_MESSAGES | always |
|
|
3461
|
-
*
|
|
3462
|
-
* @example
|
|
3463
|
-
* // Bulk deletes 2 messages with a reason of "spam"
|
|
3464
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3465
|
-
* client.channel.bulkDeleteMessages("channel id", ["message id 1", "message id 2"], "spam")
|
|
3466
|
-
*/
|
|
3467
|
-
bulkDeleteMessages(channelId: string, messages: Array<string>, reason?: string): Promise<void>;
|
|
3468
|
-
/**
|
|
3469
|
-
* Modify the permission overwrites of a guild channel
|
|
3470
|
-
* @since 0.1.0
|
|
3471
|
-
* @param channelId Id of the guild channel
|
|
3472
|
-
* @param permissionId Id of the permission overwrite
|
|
3473
|
-
* @param data modified [permission overwrite](https://discord.com/developers/docs/resources/channel#edit-channel-permissions-json-params) object
|
|
3474
|
-
* @param reason Reason for editing the channel permission
|
|
3475
|
-
* @returns Resolves the Promise on successful execution
|
|
3476
|
-
*
|
|
3477
|
-
* | Permissions needed | Condition |
|
|
3478
|
-
* |--------------------|----------------------------|
|
|
3479
|
-
* | MANAGE_CHANNELS | if channel is not a thread |
|
|
3480
|
-
* | MANAGE_THREADS | if channel is a thread |
|
|
3481
|
-
* | MANAGE_ROLES | always |
|
|
3482
|
-
* | VIEW_CHANNEL | always |
|
|
3483
|
-
*
|
|
3484
|
-
* @example
|
|
3485
|
-
* // Edits the permissions of a user to allow viewing the channel only
|
|
3486
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3487
|
-
* client.channel.editChannelPermission("channel id", "user id", { allow: String(1 << 10), type: 1 })
|
|
3488
|
-
*/
|
|
3489
|
-
editChannelPermission(channelId: string, permissionId: string, data: RESTPutAPIChannelPermissionJSONBody, reason?: string): Promise<void>;
|
|
3490
|
-
/**
|
|
3491
|
-
* Get a list of invites for a guild channel
|
|
3492
|
-
* @since 0.1.0
|
|
3493
|
-
* @param channelId Id of the guild channel
|
|
3494
|
-
* @returns Array of [invite objects](https://discord.com/developers/docs/resources/invite#invite-object) (with metadata)
|
|
3495
|
-
*
|
|
3496
|
-
* | Permissions needed | Condition |
|
|
3497
|
-
* |--------------------|-----------|
|
|
3498
|
-
* | VIEW_CHANNEL | always |
|
|
3499
|
-
* | MANAGE_CHANNELS | always |
|
|
3500
|
-
*
|
|
3501
|
-
* @example
|
|
3502
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3503
|
-
* const invites = await client.channel.getChannelInvites("channel id")
|
|
3504
|
-
*/
|
|
3505
|
-
getChannelInvites(channelId: string): Promise<RESTGetAPIChannelInvitesResult>;
|
|
3506
|
-
/**
|
|
3507
|
-
* Create an invite for a guild channel
|
|
3508
|
-
*
|
|
3509
|
-
* If no data argument is passed, the invite will be created with the defaults
|
|
3510
|
-
* @since 0.1.0
|
|
3511
|
-
* @param channelId Id of the channel
|
|
3512
|
-
* @param data invite data (optional)
|
|
3513
|
-
* @param reason Reason for creating the invite
|
|
3514
|
-
* @returns [Invite object](https://discord.com/developers/docs/resources/invite#invite-object) (with metadata)
|
|
3515
|
-
*
|
|
3516
|
-
* | Permissions needed | Condition |
|
|
3517
|
-
* |-----------------------|--------------------------------------------------------------------------|
|
|
3518
|
-
* | VIEW_CHANNEL | always |
|
|
3519
|
-
* | CREATE_INSTANT_INVITE | always |
|
|
3520
|
-
* | MANAGE_ROLES | If specifying role_ids. You cannot specify a role higher than the sender |
|
|
3521
|
-
*
|
|
3522
|
-
* @example
|
|
3523
|
-
* // Creates a unique permanent invite with infinite uses
|
|
3524
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3525
|
-
* const invite = await client.channel.createChannelInvite("channel id", { max_age: 0, max_uses: 0, unique: true })
|
|
3526
|
-
*/
|
|
3527
|
-
createChannelInvite(channelId: string, data?: RESTPostAPIChannelInviteJSONBody & {
|
|
3528
|
-
target_users?: Array<string>;
|
|
3529
|
-
role_ids?: Array<string>;
|
|
3530
|
-
}, reason?: string): Promise<RESTPostAPIChannelInviteResult>;
|
|
3531
|
-
/**
|
|
3532
|
-
* Delete a permission overwrite from a guild channel
|
|
3533
|
-
* @since 0.1.0
|
|
3534
|
-
* @param channelId Id of the guild channel
|
|
3535
|
-
* @param permissionId Id of the permission overwrite
|
|
3536
|
-
* @param reason Reason for deleting the permission
|
|
3537
|
-
* @returns Resolves the Promise on successful execution
|
|
3538
|
-
*
|
|
3539
|
-
* | Permissions needed | Condition |
|
|
3540
|
-
* |--------------------|----------------------------|
|
|
3541
|
-
* | MANAGE_CHANNELS | if channel is not a thread |
|
|
3542
|
-
* | MANAGE_THREADS | if channel is a thread |
|
|
3543
|
-
* | MANAGE_ROLES | always |
|
|
3544
|
-
* | VIEW_CHANNEL | always |
|
|
3545
|
-
*
|
|
3546
|
-
* @example
|
|
3547
|
-
* // Deletes the permission overwrite of a user
|
|
3548
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3549
|
-
* client.channel.deleteChannelPermission("channel id", "user id", "Abusing channel")
|
|
3550
|
-
*/
|
|
3551
|
-
deleteChannelPermission(channelId: string, permissionId: string, reason?: string): Promise<void>;
|
|
3552
|
-
/**
|
|
3553
|
-
* Follow an announcement channel to another channel
|
|
3554
|
-
* @since 0.7.0
|
|
3555
|
-
* @param channelId The Id of the announcement channel
|
|
3556
|
-
* @param webhookChannelId The Id of the channel messages will be sent to
|
|
3557
|
-
* @param reason Reason for following the annoucement channel
|
|
3558
|
-
* @returns A [followed channel](https://discord.com/developers/docs/resources/channel#followed-channel-object) object
|
|
3559
|
-
*
|
|
3560
|
-
* | Permissions needed | Condition |
|
|
3561
|
-
* |--------------------|-----------|
|
|
3562
|
-
* | MANAGE_WEBHOOKS | always |
|
|
3563
|
-
*
|
|
3564
|
-
* @example
|
|
3565
|
-
* // Follows an announcement channel to a text channel
|
|
3566
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3567
|
-
* client.channel.followAnnouncementChannel("news channel id", "text channel id")
|
|
3568
|
-
*/
|
|
3569
|
-
followAnnouncementChannel(channelId: string, webhookChannelId: string, reason?: string): Promise<RESTPostAPIChannelFollowersResult>;
|
|
3570
|
-
/**
|
|
3571
|
-
* Send an indicator that the current user is typing within a channel.
|
|
3572
|
-
*
|
|
3573
|
-
* **You should generally avoid this method unless used for longer computations (>1s)**
|
|
3574
|
-
* @since 0.1.0
|
|
3575
|
-
* @param channelId Id of the channel
|
|
3576
|
-
* @returns Resolves the Promise on successful execution
|
|
3577
|
-
*
|
|
3578
|
-
* | Permissions needed | Condition |
|
|
3579
|
-
* |--------------------------|--------------------------------|
|
|
3580
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3581
|
-
* | SEND_MESSAGES | if channel is not a thread |
|
|
3582
|
-
* | SEND_MESSAGES_IN_THREADS | if channel is a thread |
|
|
3583
|
-
*
|
|
3584
|
-
* @example
|
|
3585
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3586
|
-
* client.channel.sendChannelTyping("channel id")
|
|
3587
|
-
*/
|
|
3588
|
-
startChannelTyping(channelId: string): Promise<void>;
|
|
3589
|
-
/**
|
|
3590
|
-
* Get a list of pinned messages for a channel
|
|
3591
|
-
* @since 0.1.0
|
|
3592
|
-
* @param channelId Id of the channel
|
|
3593
|
-
* @returns Array of [message objects](https://discord.com/developers/docs/resources/channel#message-object)
|
|
3594
|
-
*
|
|
3595
|
-
* | Permissions needed | Condition |
|
|
3596
|
-
* |----------------------|--------------------------------|
|
|
3597
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3598
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel |
|
|
3599
|
-
*
|
|
3600
|
-
* @example
|
|
3601
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3602
|
-
* const messages = await client.channel.getPinnedMessages("channel id")
|
|
3603
|
-
*/
|
|
3604
|
-
getChannelPinnedMessages(channelId: string, options?: RESTGetAPIChannelMessagesPinsQuery): Promise<RESTGetAPIChannelMessagesPinsResult>;
|
|
3605
|
-
/**
|
|
3606
|
-
* Pin a message within a channel
|
|
3607
|
-
* @since 0.1.0
|
|
3608
|
-
* @param channelId Id of the channel
|
|
3609
|
-
* @param messageId Id of the message
|
|
3610
|
-
* @param reason Reason for pinning the message
|
|
3611
|
-
* @returns Resolves the Promise on successful execution
|
|
3612
|
-
*
|
|
3613
|
-
* | Permissions needed | Condition |
|
|
3614
|
-
* |----------------------|--------------------------------|
|
|
3615
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3616
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel |
|
|
3617
|
-
* | PIN_MESSAGES | if channel is not a DM channel |
|
|
3618
|
-
*
|
|
3619
|
-
* @example
|
|
3620
|
-
* // Pin a message because it was a good meme
|
|
3621
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3622
|
-
* client.channel.addChannelPinnedMessage("channel id", "message id", "Good meme")
|
|
3623
|
-
*/
|
|
3624
|
-
addChannelPinnedMessage(channelId: string, messageId: string, reason?: string): Promise<void>;
|
|
3625
|
-
/**
|
|
3626
|
-
* Remove a pinned message from a channel
|
|
3627
|
-
* @since 0.1.0
|
|
3628
|
-
* @param channelId Id of the channel
|
|
3629
|
-
* @param messageId Id of the message
|
|
3630
|
-
* @param reason Reason for removing the pinned message
|
|
3631
|
-
* @returns Resolves the Promise on successful execution
|
|
3632
|
-
*
|
|
3633
|
-
* | Permissions needed | Condition |
|
|
3634
|
-
* |----------------------|--------------------------------|
|
|
3635
|
-
* | VIEW_CHANNEL | if channel is not a DM channel |
|
|
3636
|
-
* | READ_MESSAGE_HISTORY | if channel is not a DM channel |
|
|
3637
|
-
* | PIN_MESSAGES | if channel is not a DM channel |
|
|
3638
|
-
*
|
|
3639
|
-
* @example
|
|
3640
|
-
* // Remove a pinned message because mod abuse :(
|
|
3641
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3642
|
-
* client.channel.removeChannelPinnedMessage("channel id", "message id", "Mod abuse")
|
|
3643
|
-
*/
|
|
3644
|
-
removeChannelPinnedMessage(channelId: string, messageId: string, reason?: string): Promise<void>;
|
|
3645
|
-
/**
|
|
3646
|
-
* Creates a public thread off a message in a guild channel
|
|
3647
|
-
* @since 0.3.0
|
|
3648
|
-
* @param channelId Id of the guild channel
|
|
3649
|
-
* @param messageId Id of the message
|
|
3650
|
-
* @param data Thread meta data
|
|
3651
|
-
* @param reason Reason for creating the thread
|
|
3652
|
-
* @returns [thread channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
3653
|
-
*
|
|
3654
|
-
* | Permissions needed | Condition |
|
|
3655
|
-
* |-----------------------|-----------|
|
|
3656
|
-
* | VIEW_CHANNEL | always |
|
|
3657
|
-
* | CREATE_PUBLIC_THREADS | always |
|
|
3658
|
-
*
|
|
3659
|
-
* @example
|
|
3660
|
-
* // Create a thread off a cool art piece to discuss
|
|
3661
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3662
|
-
* const thread = await client.channel.createThreadWithMessage("channel id", "message id", { name: "cool-art", }, "I wanna talk about it!")
|
|
3663
|
-
*/
|
|
3664
|
-
createThreadWithMessage(channelId: string, messageId: string, data: RESTPostAPIChannelMessagesThreadsJSONBody, reason?: string): Promise<RESTPostAPIChannelMessagesThreadsResult>;
|
|
3665
|
-
/**
|
|
3666
|
-
* Creates a thread under a guild channel without a message
|
|
3667
|
-
* @since 0.3.0
|
|
3668
|
-
* @param channelId Id of the guild channel
|
|
3669
|
-
* @param data Thread meta data
|
|
3670
|
-
* @param reason Reason for creating the thread
|
|
3671
|
-
* @returns [thread channel](https://discord.com/developers/docs/resources/channel#channel-object) object
|
|
3672
|
-
*
|
|
3673
|
-
* | Permissions needed | Condition |
|
|
3674
|
-
* |------------------------|------------------------------|
|
|
3675
|
-
* | VIEW_CHANNEL | always |
|
|
3676
|
-
* | CREATE_PUBLIC_THREADS | if creating a public thread |
|
|
3677
|
-
* | CREATE_PRIVATE_THREADS | if creating a private thread |
|
|
3678
|
-
*
|
|
3679
|
-
* @example
|
|
3680
|
-
* // Creates a private thread that's invitable to talk about someone's birthday
|
|
3681
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3682
|
-
* const thread = await client.channel.createThreadWithoutMessage("channel id", { name: "persons-birthday", type: 12, invitable: true }, "Shh! It's a surprise")
|
|
3683
|
-
*/
|
|
3684
|
-
createThreadWithoutMessage(channelId: string, data: Omit<RESTPostAPIChannelThreadsJSONBody, "type"> & {
|
|
3685
|
-
type: 10;
|
|
3686
|
-
}, reason?: string): Promise<APITextBasedChannel<ChannelType.AnnouncementThread>>;
|
|
3687
|
-
createThreadWithoutMessage(channelId: string, data: Omit<RESTPostAPIChannelThreadsJSONBody, "type"> & {
|
|
3688
|
-
type: 11;
|
|
3689
|
-
}, reason?: string): Promise<APITextBasedChannel<ChannelType.PublicThread>>;
|
|
3690
|
-
createThreadWithoutMessage(channelId: string, data: Omit<RESTPostAPIChannelThreadsJSONBody, "type"> & {
|
|
3691
|
-
type: 12;
|
|
3692
|
-
}, reason?: string): Promise<APITextBasedChannel<ChannelType.PrivateThread>>;
|
|
3693
|
-
/**
|
|
3694
|
-
* Join a thread
|
|
3695
|
-
* @since 0.3.0
|
|
3696
|
-
* @param threadId Id of the thread
|
|
3697
|
-
* @returns Resolves the Promise on successful execution
|
|
3698
|
-
*
|
|
3699
|
-
* | Permissions needed | Condition |
|
|
3700
|
-
* |--------------------|-----------|
|
|
3701
|
-
* | VIEW_CHANNEL | always |
|
|
3702
|
-
*
|
|
3703
|
-
* @example
|
|
3704
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3705
|
-
* client.channel.joinThread("thread id")
|
|
3706
|
-
*/
|
|
3707
|
-
joinThread(threadId: string): Promise<void>;
|
|
3708
|
-
/**
|
|
3709
|
-
* Add a user to a thread
|
|
3710
|
-
*
|
|
3711
|
-
* CurrentUser must be a member of the thread
|
|
3712
|
-
* @since 0.3.0
|
|
3713
|
-
* @param threadId Id of the thread
|
|
3714
|
-
* @param userId Id of the user to add
|
|
3715
|
-
* @returns Resolves the Promise on successful execution
|
|
3716
|
-
*
|
|
3717
|
-
* | Permissions needed | Condition |
|
|
3718
|
-
* |-----------------------------|-----------|
|
|
3719
|
-
* | CurrentUser added to Thread | always |
|
|
3720
|
-
* | SEND_MESSAGES_IN_THREADS | always |
|
|
3721
|
-
*
|
|
3722
|
-
* @example
|
|
3723
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3724
|
-
* client.channel.addThreadMember("thread id", "user id")
|
|
3725
|
-
*/
|
|
3726
|
-
addThreadMember(threadId: string, userId: string): Promise<void>;
|
|
3727
|
-
/**
|
|
3728
|
-
* Leave a thread
|
|
3729
|
-
* @since 0.3.0
|
|
3730
|
-
* @param threadId Id of the thread
|
|
3731
|
-
* @returns Resolves the Promise on successful execution
|
|
3732
|
-
*
|
|
3733
|
-
* @example
|
|
3734
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3735
|
-
* client.channel.leaveThread("thread id")
|
|
3736
|
-
*/
|
|
3737
|
-
leaveThread(threadId: string): Promise<void>;
|
|
3738
|
-
/**
|
|
3739
|
-
* Remove a user from a thread
|
|
3740
|
-
* @since 0.3.0
|
|
3741
|
-
* @param threadId Id of the thread
|
|
3742
|
-
* @param userId Id of the user to remove
|
|
3743
|
-
* @returns Resolves the Promise on successful execution
|
|
3744
|
-
*
|
|
3745
|
-
* | Permissions needed | Condition |
|
|
3746
|
-
* |--------------------|------------------------------------------------------|
|
|
3747
|
-
* | MANAGE_THREADS | if the current user is not the creator of the thread |
|
|
3748
|
-
*
|
|
3749
|
-
* @example
|
|
3750
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3751
|
-
* client.channel.removeThreadMember("thread id", "user id")
|
|
3752
|
-
*/
|
|
3753
|
-
removeThreadMember(threadId: string, userId: string): Promise<void>;
|
|
3754
|
-
/**
|
|
3755
|
-
* Gets a member of a thread
|
|
3756
|
-
* @since 0.3.0
|
|
3757
|
-
* @param threadId Id of the thread
|
|
3758
|
-
* @param userId Id of the user
|
|
3759
|
-
* @param withMember If a member object should be present
|
|
3760
|
-
* @returns A [thread member](https://discord.com/developers/docs/resources/channel#thread-member-object)
|
|
3761
|
-
*
|
|
3762
|
-
* | Permissions needed | Condition |
|
|
3763
|
-
* |--------------------|-----------|
|
|
3764
|
-
* | VIEW_CHANNEL | always |
|
|
3765
|
-
*
|
|
3766
|
-
* @example
|
|
3767
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3768
|
-
* const member = await client.channel.getThreadMember("thread id", "user id")
|
|
3769
|
-
*/
|
|
3770
|
-
getThreadMember(threadId: string, userId: string, withMember?: boolean): Promise<RESTGetAPIChannelThreadMemberResult>;
|
|
3771
|
-
/**
|
|
3772
|
-
* Gets all members within a thread
|
|
3773
|
-
* @since 0.3.0
|
|
3774
|
-
* @param channelId Id of the Thread
|
|
3775
|
-
* @param options Options for getting members
|
|
3776
|
-
* @returns Array of [thread members](https://discord.com/developers/docs/resources/channel#thread-member-object)
|
|
3777
|
-
*
|
|
3778
|
-
* | Permissions needed | Condition |
|
|
3779
|
-
* |--------------------|-----------|
|
|
3780
|
-
* | VIEW_CHANNEL | always |
|
|
3781
|
-
*
|
|
3782
|
-
* | Intents |
|
|
3783
|
-
* |---------------|
|
|
3784
|
-
* | GUILD_MEMBERS |
|
|
3785
|
-
*
|
|
3786
|
-
* @example
|
|
3787
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3788
|
-
* const members = await client.channel.getThreadMembers("thread id")
|
|
3789
|
-
*/
|
|
3790
|
-
getThreadMembers(channelId: string, options?: RESTGetAPIChannelThreadMembersQuery): Promise<RESTGetAPIChannelThreadMembersResult>;
|
|
3791
|
-
/**
|
|
3792
|
-
* Gets all threads that are public and archived within a guild channel
|
|
3793
|
-
* @since 0.3.0
|
|
3794
|
-
* @param channelId Id of the guild channel
|
|
3795
|
-
* @param options Options for getting threads
|
|
3796
|
-
* @returns Object containing [public threads](https://discord.com/developers/docs/resources/channel#channel-object), [thread members](https://discord.com/developers/docs/resources/channel#thread-member-object) of the CurrentUser, and if there are more results in the pagination
|
|
3797
|
-
*
|
|
3798
|
-
* | Permissions needed | Condition |
|
|
3799
|
-
* |----------------------|-----------|
|
|
3800
|
-
* | VIEW_CHANNEL | always |
|
|
3801
|
-
* | READ_MESSAGE_HISTORY | always |
|
|
3802
|
-
*
|
|
3803
|
-
* @example
|
|
3804
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3805
|
-
* const result = await client.channel.getChannelArchivedPublicThreads("channel id")
|
|
3806
|
-
*/
|
|
3807
|
-
getChannelArchivedPublicThreads(channelId: string, options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelThreadsArchivedPublicResult>;
|
|
3808
|
-
/**
|
|
3809
|
-
* Gets all threads that are private and archived within a guild channel
|
|
3810
|
-
*
|
|
3811
|
-
* CurrentUser must be a member of the thread if they do not have MANAGE_THREADS permissions
|
|
3812
|
-
* @since 0.3.0
|
|
3813
|
-
* @param channelId Id of the Channel
|
|
3814
|
-
* @param options Options for getting threads
|
|
3815
|
-
* @returns Object containing [private threads](https://discord.com/developers/docs/resources/channel#channel-object), [thread members](https://discord.com/developers/docs/resources/channel#thread-member-object) of the CurrentUser, and if there are more results in the pagination
|
|
3816
|
-
*
|
|
3817
|
-
* | Permissions needed | Condition |
|
|
3818
|
-
* |----------------------|--------------------------------------|
|
|
3819
|
-
* | VIEW_CHANNEL | always |
|
|
3820
|
-
* | READ_MESSAGE_HISTORY | always |
|
|
3821
|
-
* | MANAGE_THREADS | if CurrentUser isn't added to Thread |
|
|
3822
|
-
*
|
|
3823
|
-
* @example
|
|
3824
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3825
|
-
* const result = await client.channel.getChannelArchivedPrivateThreads("channel id")
|
|
3826
|
-
*/
|
|
3827
|
-
getChannelArchivedPrivateThreads(channelId: string, options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelThreadsArchivedPrivateResult>;
|
|
3828
|
-
/**
|
|
3829
|
-
* Gets all threads that are private and archived within a guild channel that the CurrentUser is apart of
|
|
3830
|
-
*
|
|
3831
|
-
* CurrentUser must be a member of the thread if they do not have MANAGE_THREADS permissions
|
|
3832
|
-
* @since 0.3.0
|
|
3833
|
-
* @param channelId Id of the Channel
|
|
3834
|
-
* @param options Option for getting threads
|
|
3835
|
-
* @returns Object containing [private threads](https://discord.com/developers/docs/resources/channel#channel-object), [thread members](https://discord.com/developers/docs/resources/channel#thread-member-object) of the CurrentUser, and if there are more results in the pagination
|
|
3836
|
-
*
|
|
3837
|
-
* | Permissions needed | Condition |
|
|
3838
|
-
* |--------------------|-----------|
|
|
3839
|
-
* | VIEW_CHANNEL | always |
|
|
3840
|
-
*
|
|
3841
|
-
* @example
|
|
3842
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3843
|
-
* const result = await client.channel.getChannelArchivedPrivateThreadsUser("channel id")
|
|
3844
|
-
*/
|
|
3845
|
-
getChannelArchivedPrivateThreadsUser(channelId: string, options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelUsersThreadsArchivedResult>;
|
|
3846
|
-
/**
|
|
3847
|
-
* Refreshes Discord CDN attachments by URL to give you non-expired links. This also works on attachments the token may not have access to through means like guild bot presence
|
|
3848
|
-
* @since 0.10.7
|
|
3849
|
-
* @param attachments A list of Discord CDN attachment URLs. Does not require the URL(s) to have the expiration info parameters
|
|
3850
|
-
* @returns Object containing a list of the original URLs inputted and refreshed URLs
|
|
3851
|
-
*
|
|
3852
|
-
* @example
|
|
3853
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3854
|
-
* const result = await client.channel.refreshAttachmentURLs("https://cdn.discordapp.com/attachments/1109362097952931840/1277799507911905280/traveler.gif")
|
|
3855
|
-
*/
|
|
3856
|
-
refreshAttachmentURLs(attachments: string | Array<string>): Promise<RESTPostAPIAttachmentsRefreshURLsResult>;
|
|
3857
|
-
/**
|
|
3858
|
-
* Get a list of users that voted for this specific answer
|
|
3859
|
-
* @since 0.13.0
|
|
3860
|
-
* @param channelId Id of the channel
|
|
3861
|
-
* @param messageId Id of the message
|
|
3862
|
-
* @param answerId Id of the answer
|
|
3863
|
-
* @param options Options for getting the poll answers
|
|
3864
|
-
* @returns An [answer object](https://discord.com/developers/docs/resources/poll#get-answer-voters-response-body)
|
|
3865
|
-
*
|
|
3866
|
-
* @example
|
|
3867
|
-
* // Get whoever voted for an answer
|
|
3868
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3869
|
-
* const data = await client.channel.getPollAnswerVoters("channel id", "message id", "answer id")
|
|
3870
|
-
*/
|
|
3871
|
-
getPollAnswerVoters(channelId: string, messageId: string, answerId: string, options?: RESTGetAPIPollAnswerVotersQuery): Promise<RESTGetAPIPollAnswerVotersResult>;
|
|
3872
|
-
/**
|
|
3873
|
-
* Immediately ends the poll. You cannot end polls from other users
|
|
3874
|
-
* @since 0.13.0
|
|
3875
|
-
* @param channelId Id of the channel
|
|
3876
|
-
* @param messageId Id of the message
|
|
3877
|
-
* @returns A [message object](https://discord.com/developers/docs/resources/message#message-object)
|
|
3878
|
-
*
|
|
3879
|
-
* @example
|
|
3880
|
-
* // End a poll that the bot made
|
|
3881
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3882
|
-
* client.channel.endPoll("channel id", "message id")
|
|
3883
|
-
*/
|
|
3884
|
-
endPoll(channelId: string, messageId: string): Promise<RESTPostAPIPollExpireResult>;
|
|
3885
|
-
/**
|
|
3886
|
-
* Sets a voice channel's status message
|
|
3887
|
-
* @since 0.17.0
|
|
3888
|
-
* @param channelId Id of the channel
|
|
3889
|
-
* @param status The new status of the voice channel
|
|
3890
|
-
* @param reason Reason for changing the status
|
|
3891
|
-
* @returns Resolves the Promise on successful execution
|
|
3892
|
-
*
|
|
3893
|
-
* | Permissions needed | Condition |
|
|
3894
|
-
* |--------------------------|---------------------------------------|
|
|
3895
|
-
* | VIEW_CHANNEL | always |
|
|
3896
|
-
* | SET_VOICE_CHANNEL_STATUS | always |
|
|
3897
|
-
* | MANAGE_CHANNELS | if CurrentUser isn't in voice channel |
|
|
3898
|
-
*
|
|
3899
|
-
* @example
|
|
3900
|
-
* // Sets the status to poggers
|
|
3901
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3902
|
-
* client.channel.setVoiceChannelStatus("channel id", "poggers")
|
|
3903
|
-
*
|
|
3904
|
-
* @example
|
|
3905
|
-
* // clears the status
|
|
3906
|
-
* client.channel.setVoiceChannelStatus("channel id", "")
|
|
3907
|
-
*/
|
|
3908
|
-
setVoiceChannelStatus(channelId: string, status: string, reason?: string): Promise<void>;
|
|
3909
|
-
/**
|
|
3910
|
-
* Sets a voice channel's "vibe" as Discord calls it, but it's actually just an image over all participants of a channel others in and not in the channel can see
|
|
3911
|
-
* @since 0.17.6
|
|
3912
|
-
* @param channelId Id of the channel
|
|
3913
|
-
* @param imageUrl URL of an image to display
|
|
3914
|
-
* @param reason Reason for changing the image
|
|
3915
|
-
* @returns A [Guild Voice Channel](https://discord.com/developers/docs/resources/channel#channel-object)
|
|
3916
|
-
*
|
|
3917
|
-
* | Permissions needed | Condition |
|
|
3918
|
-
* |--------------------------|---------------------------------------|
|
|
3919
|
-
* | VIEW_CHANNEL | always |
|
|
3920
|
-
* | SET_VOICE_CHANNEL_STATUS | always |
|
|
3921
|
-
* | MANAGE_CHANNELS | if CurrentUser isn't in voice channel |
|
|
3922
|
-
*
|
|
3923
|
-
* @example
|
|
3924
|
-
* // Sets the "vibe" image of the voice channel to Rick
|
|
3925
|
-
* const client = new SnowTransfer("TOKEN")
|
|
3926
|
-
* client.channel.setVoiceChannelHangout("channel id", "https://i3.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg")
|
|
3927
|
-
*
|
|
3928
|
-
* @example
|
|
3929
|
-
* // clears the image
|
|
3930
|
-
* client.channel.setVoiceChannelHangout("channel id", "")
|
|
3931
|
-
*/
|
|
3932
|
-
setVoiceChannelHangout(channelId: string, imageUrl: string, reason?: string): Promise<APIGuildVoiceChannel>;
|
|
3933
|
-
}
|
|
3934
|
-
|
|
3935
|
-
/**
|
|
3936
|
-
* Get an oauth token after being authorized
|
|
3937
|
-
* @since 0.11.0
|
|
3938
|
-
* @param clientId The ID of your application. For older bots, this is different from your bot's user ID
|
|
3939
|
-
* @param redirectURI The URI Discord will redirect the user to after they authorize
|
|
3940
|
-
* @param clientSecret The secret of your client you can obtain from the Application page
|
|
3941
|
-
* @param code The code returned from Discord from the oauth authorize flow
|
|
3942
|
-
* @returns The authorization
|
|
3943
|
-
*
|
|
3944
|
-
* @example
|
|
3945
|
-
* const { tokenless } = require("snowtransfer")
|
|
3946
|
-
* const result = await tokenless.getOauth2Token(id, redirectURI, secret, code)
|
|
3947
|
-
*/
|
|
3948
|
-
declare function getOauth2Token(clientId: string, redirectURI: string, clientSecret: string, code: string): Promise<RESTPostOAuth2AccessTokenResult>;
|
|
3949
|
-
declare const _default: {
|
|
3950
|
-
getOauth2Token: typeof getOauth2Token;
|
|
3951
|
-
};
|
|
3952
|
-
|
|
3953
|
-
declare const Constants: {
|
|
3954
|
-
REST_API_VERSION: 10;
|
|
3955
|
-
GET_CHANNEL_MESSAGES_MIN_RESULTS: 1;
|
|
3956
|
-
GET_CHANNEL_MESSAGES_MAX_RESULTS: 100;
|
|
3957
|
-
GET_GUILD_SCHEDULED_EVENT_USERS_MIN_RESULTS: 1;
|
|
3958
|
-
GET_GUILD_SCHEDULED_EVENT_USERS_MAX_RESULTS: 100;
|
|
3959
|
-
SEARCH_MEMBERS_MIN_RESULTS: 1;
|
|
3960
|
-
SEARCH_MEMBERS_MAX_RESULTS: 1000;
|
|
3961
|
-
BULK_DELETE_MESSAGES_MIN: 2;
|
|
3962
|
-
BULK_DELETE_MESSAGES_MAX: 100;
|
|
3963
|
-
OK_STATUS_CODES: Set<number>;
|
|
3964
|
-
DO_NOT_RETRY_STATUS_CODES: Set<number>;
|
|
3965
|
-
DEFAULT_RETRY_LIMIT: number;
|
|
3966
|
-
GLOBAL_REQUESTS_PER_SECOND: number;
|
|
3967
|
-
standardMultipartHandler(data: {
|
|
3968
|
-
files: Array<{
|
|
3969
|
-
name: string;
|
|
3970
|
-
file: Buffer | Blob | File$1 | Readable | ReadableStream;
|
|
3971
|
-
}>;
|
|
3972
|
-
data?: any;
|
|
3973
|
-
}): Promise<FormData>;
|
|
3974
|
-
standardAddToFormHandler(form: FormData, name: string, value: string | Buffer | Blob | File$1 | Readable | ReadableStream, filename?: string): Promise<void>;
|
|
3975
|
-
reasonHeader(reason?: string): {
|
|
3976
|
-
"X-Audit-Log-Reason"?: string;
|
|
3977
|
-
};
|
|
3978
|
-
};
|
|
3979
|
-
|
|
3980
|
-
/**
|
|
3981
|
-
* Mostly taken from https://github.com/abalabahaha/eris/blob/master/lib/rest/Endpoints.js
|
|
3982
|
-
*
|
|
3983
|
-
* Removed User-only endpoints
|
|
3984
|
-
*/
|
|
3985
|
-
declare const Endpoints: {
|
|
3986
|
-
BASE_URL: `/api/v${typeof Constants.REST_API_VERSION}`;
|
|
3987
|
-
BASE_HOST: "https://discord.com";
|
|
3988
|
-
CDN_URL: "https://cdn.discordapp.com";
|
|
3989
|
-
APPLICATION_COMMAND: (appId: string, cmdId: string) => `${ReturnType<typeof Endpoints.APPLICATION_COMMANDS>}/{cmd_id}`;
|
|
3990
|
-
APPLICATION_COMMANDS: (appId: string) => "/applications/{app_id}/commands";
|
|
3991
|
-
APPLICATION_EMOJI: (appId: string, emojiId: string) => `${ReturnType<typeof Endpoints.APPLICATION_EMOJIS>}/{emoji_id}`;
|
|
3992
|
-
APPLICATION_EMOJIS: (appId: string) => "/applications/{app_id}/emojis";
|
|
3993
|
-
APPLICATION_ENTITLEMENT: (appId: string, entitlementId: string) => `${ReturnType<typeof Endpoints.APPLICATION_ENTITLEMENTS>}/{entitlement_id}`;
|
|
3994
|
-
APPLICATION_ENTITLEMENT_CONSUME: (appId: string, entitlementId: string) => `${ReturnType<typeof Endpoints.APPLICATION_ENTITLEMENT>}/consume`;
|
|
3995
|
-
APPLICATION_ENTITLEMENTS: (appId: string) => "/applications/{app_id}/entitlements";
|
|
3996
|
-
APPLICATION_GUILD_COMMANDS_PERMISSIONS: (appId: string, guildId: string) => `${ReturnType<typeof Endpoints.APPLICATION_GUILD_COMMANDS>}/permissions`;
|
|
3997
|
-
APPLICATION_GUILD_COMMAND_PERMISSIONS: (appId: string, guildId: string, cmdId: string) => `${ReturnType<typeof Endpoints.APPLICATION_GUILD_COMMAND>}/permissions`;
|
|
3998
|
-
APPLICATION_GUILD_COMMAND: (appId: string, guildId: string, cmdId: string) => `${ReturnType<typeof Endpoints.APPLICATION_GUILD_COMMANDS>}/{cmd_id}`;
|
|
3999
|
-
APPLICATION_GUILD_COMMANDS: (appId: string, guildId: string) => "/applications/{app_id}/guilds/{guild_id}/commands";
|
|
4000
|
-
APPLICATION_SKUS: (appId: string) => "/applications/{app_id}/skus";
|
|
4001
|
-
ATTACHMENTS_REFRESH_URLS: "/attachments/refresh-urls";
|
|
4002
|
-
CHANNEL: (chanId: string) => `${typeof Endpoints.CHANNELS}/{channel_id}`;
|
|
4003
|
-
CHANNEL_ATTACHMENTS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/attachments`;
|
|
4004
|
-
CHANNEL_BULK_DELETE: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGES>}/bulk-delete`;
|
|
4005
|
-
CHANNEL_FOLLOWERS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/followers`;
|
|
4006
|
-
CHANNEL_INVITES: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/invites`;
|
|
4007
|
-
CHANNEL_MESSAGE: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGES>}/{message_id}`;
|
|
4008
|
-
CHANNEL_MESSAGE_CROSSPOST: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE>}/crosspost`;
|
|
4009
|
-
CHANNEL_MESSAGE_REACTION: (chanId: string, msgId: string, reaction: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE_REACTIONS>}/{reaction}`;
|
|
4010
|
-
CHANNEL_MESSAGE_REACTION_USER: (chanId: string, msgId: string, reaction: string, userId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE_REACTION>}/{user_id}`;
|
|
4011
|
-
CHANNEL_MESSAGE_REACTIONS: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE>}/reactions`;
|
|
4012
|
-
CHANNEL_MESSAGE_THREADS: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_MESSAGE>}/threads`;
|
|
4013
|
-
CHANNEL_MESSAGES: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/messages`;
|
|
4014
|
-
CHANNEL_PERMISSION: (chanId: string, permId: string) => `${ReturnType<typeof Endpoints.CHANNEL_PERMISSIONS>}/{perm_id}`;
|
|
4015
|
-
CHANNEL_PERMISSIONS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/permissions`;
|
|
4016
|
-
CHANNEL_PIN: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL_PINS>}/{message_id}`;
|
|
4017
|
-
CHANNEL_PINS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/messages/pins`;
|
|
4018
|
-
CHANNEL_RECIPIENT: (chanId: string, userId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/recipients/{user_id}`;
|
|
4019
|
-
CHANNEL_THREADS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/threads`;
|
|
4020
|
-
CHANNEL_THREAD_MEMBER: (chanId: string, memberId: string) => `${ReturnType<typeof Endpoints.CHANNEL_THREAD_MEMBERS>}/{member_id}`;
|
|
4021
|
-
CHANNEL_THREAD_MEMBERS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/thread-members`;
|
|
4022
|
-
CHANNEL_THREADS_ARCHIVED_PRIVATE: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL_THREADS>}/archived/private`;
|
|
4023
|
-
CHANNEL_THREADS_ARCHIVED_PRIVATE_USER: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/users/@me/threads/archived/private`;
|
|
4024
|
-
CHANNEL_THREADS_ARCHIVED_PUBLIC: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL_THREADS>}/archived/public`;
|
|
4025
|
-
CHANNEL_TYPING: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/typing`;
|
|
4026
|
-
CHANNEL_VOICE_STATUS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/voice-status`;
|
|
4027
|
-
CHANNEL_VOICE_HANGOUT: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/voice-hangout`;
|
|
4028
|
-
CHANNEL_WEBHOOKS: (chanId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/webhooks`;
|
|
4029
|
-
CHANNELS: "/channels";
|
|
4030
|
-
GATEWAY: "/gateway";
|
|
4031
|
-
GATEWAY_BOT: "/gateway/bot";
|
|
4032
|
-
GUILD: (guildId: string) => `${typeof Endpoints.GUILDS}/{guild_id}`;
|
|
4033
|
-
GUILD_AUDIT_LOGS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/audit-logs`;
|
|
4034
|
-
GUILD_AUTO_MOD_RULE: (guildId: string, ruleId: string) => `${ReturnType<typeof Endpoints.GUILD_AUTO_MOD_RULES>}/{rule_id}`;
|
|
4035
|
-
GUILD_AUTO_MOD_RULES: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/auto-moderation/rules`;
|
|
4036
|
-
GUILD_BAN: (guildId: string, memberId: string) => `${ReturnType<typeof Endpoints.GUILD_BANS>}/{member_id}`;
|
|
4037
|
-
GUILD_BANS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/bans`;
|
|
4038
|
-
GUILD_CHANNELS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/channels`;
|
|
4039
|
-
GUILD_EMOJI: (guildId: string, emojiId: string) => `${ReturnType<typeof Endpoints.GUILD_EMOJIS>}/{emoji_id}`;
|
|
4040
|
-
GUILD_EMOJIS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/emojis`;
|
|
4041
|
-
GUILD_INVITES: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/invites`;
|
|
4042
|
-
GUILD_INTEGRATION: (guildId: string, integrationId: string) => `${ReturnType<typeof Endpoints.GUILD_INTEGRATIONS>}/{integration_id}`;
|
|
4043
|
-
GUILD_INTEGRATIONS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/integrations`;
|
|
4044
|
-
GUILD_MEMBER: (guildId: string, memberId: string) => `${ReturnType<typeof Endpoints.GUILD_MEMBERS>}/{member_id}`;
|
|
4045
|
-
GUILD_MEMBER_ROLE: (guildId: string, memberId: string, roleId: string) => `${ReturnType<typeof Endpoints.GUILD_MEMBER>}/roles/{role_id}`;
|
|
4046
|
-
GUILD_MEMBERS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/members`;
|
|
4047
|
-
GUILD_MEMBERS_SEARCH: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD_MEMBERS>}/search`;
|
|
4048
|
-
GUILD_MESSAGES_SEARCH: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/messages/search`;
|
|
4049
|
-
GUILD_PREVIEW: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/preview`;
|
|
4050
|
-
GUILD_PRUNE: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/prune`;
|
|
4051
|
-
GUILD_ROLE: (guildId: string, roleId: string) => `${ReturnType<typeof Endpoints.GUILD_ROLES>}/{role_id}`;
|
|
4052
|
-
GUILD_ROLES: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/roles`;
|
|
4053
|
-
GUILD_SCHEDULED_EVENTS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/scheduled-events`;
|
|
4054
|
-
GUILD_SCHEDULED_EVENT: (guildId: string, eventId: string) => `${ReturnType<typeof Endpoints.GUILD_SCHEDULED_EVENTS>}/{event_id}`;
|
|
4055
|
-
GUILD_SCHEDULED_EVENT_USERS: (guildId: string, eventId: string) => `${ReturnType<typeof Endpoints.GUILD_SCHEDULED_EVENT>}/users`;
|
|
4056
|
-
GUILD_STICKER: (guildId: string, stickerId: string) => `${ReturnType<typeof Endpoints.GUILD_STICKERS>}/{sticker_id}`;
|
|
4057
|
-
GUILD_STICKERS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/stickers`;
|
|
4058
|
-
GUILD_TEMPLATE: (guildId: string, code: string) => `${ReturnType<typeof Endpoints.GUILD_TEMPLATES>}/{code}`;
|
|
4059
|
-
GUILD_THREADS_ACTIVE: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/threads/active`;
|
|
4060
|
-
GUILD_TEMPLATES: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/templates`;
|
|
4061
|
-
GUILD_VANITY: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/vanity-url`;
|
|
4062
|
-
GUILD_VOICE_REGIONS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/regions`;
|
|
4063
|
-
GUILD_VOICE_STATE_USER: (guildId: string, memberId: string) => `${ReturnType<typeof Endpoints.GUILD>}/voice-states/{member_id}`;
|
|
4064
|
-
GUILD_WEBHOOKS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/webhooks`;
|
|
4065
|
-
GUILD_WELCOME_SCREEN: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/welcome-screen`;
|
|
4066
|
-
GUILD_WIDGET: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/widget.json`;
|
|
4067
|
-
GUILD_WIDGET_SETTINGS: (guildId: string) => `${ReturnType<typeof Endpoints.GUILD>}/widget`;
|
|
4068
|
-
GUILDS: "/guilds";
|
|
4069
|
-
INTERACTION_CALLBACK: (interactionId: string, token: string) => "/interactions/{interaction_id}/{token}/callback";
|
|
4070
|
-
INVITES: (inviteId: string) => "/invites/{invite_id}";
|
|
4071
|
-
INVITE_TARGET_USERS: (inviteId: string) => `${ReturnType<typeof Endpoints.INVITES>}/target-users`;
|
|
4072
|
-
INVITE_TARGET_USERS_JOB_STATUS: (inviteId: string) => `${ReturnType<typeof Endpoints.INVITE_TARGET_USERS>}/job-status`;
|
|
4073
|
-
OAUTH2_APPLICATION: (appId: string) => "/oauth2/applications/{app_id}";
|
|
4074
|
-
OAUTH2_TOKEN: "/api/oauth2/token";
|
|
4075
|
-
POLL_ANSWER: (chanId: string, msgId: string, answerId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/polls/{message_id}/answers/{answer_id}`;
|
|
4076
|
-
POLL_EXPIRE: (chanId: string, msgId: string) => `${ReturnType<typeof Endpoints.CHANNEL>}/polls/{message_id}/expire`;
|
|
4077
|
-
SKU_SUBSCRIPTIONS: (skuId: string) => "/skus/{sku_id}/subscriptions";
|
|
4078
|
-
SKU_SUBSCRIPTION: (skuId: string, subscriptionId: string) => `${ReturnType<typeof Endpoints.SKU_SUBSCRIPTIONS>}/{subscription_id}`;
|
|
4079
|
-
STAGE_INSTANCE_CHANNEL: (chanId: string) => `${typeof Endpoints.STAGE_INSTANCES}/{channel_id}`;
|
|
4080
|
-
STAGE_INSTANCES: "/stage-instances";
|
|
4081
|
-
STICKER: (stickerId: string) => "/stickers/{sticker_id}";
|
|
4082
|
-
TEMPLATE: (code: string) => "/guilds/templates/{code}";
|
|
4083
|
-
USER: (userId: string) => `${typeof Endpoints.USERS}/{user_id}`;
|
|
4084
|
-
USER_APPLICATION_ROLE_CONNECTION: (userId: string, appId: string) => `${ReturnType<typeof Endpoints.USER>}/applications/{app_id}/role-connection`;
|
|
4085
|
-
USER_CHANNELS: (userId: string) => `${ReturnType<typeof Endpoints.USER>}/channels`;
|
|
4086
|
-
USER_CONNECTIONS: (userId: string) => `${ReturnType<typeof Endpoints.USER>}/connections`;
|
|
4087
|
-
USER_GUILD: (userId: string, guildId: string) => `${ReturnType<typeof Endpoints.USER_GUILDS>}/{guild_id}`;
|
|
4088
|
-
USER_GUILDS: (userId: string) => `${ReturnType<typeof Endpoints.USER>}/guilds`;
|
|
4089
|
-
USER_GUILD_VOICE_STATE: (guildId: string, userId: string) => `${ReturnType<typeof Endpoints.GUILD>}/voice-states/{user_id}`;
|
|
4090
|
-
USERS: "/users";
|
|
4091
|
-
VOICE_REGIONS: "/voice/regions";
|
|
4092
|
-
WEBHOOK: (hookId: string) => "/webhooks/{hook_id}";
|
|
4093
|
-
WEBHOOK_TOKEN: (hookId: string, token: string) => `${ReturnType<typeof Endpoints.WEBHOOK>}/{token}`;
|
|
4094
|
-
WEBHOOK_TOKEN_GITHUB: (hookId: string, token: string) => `${ReturnType<typeof Endpoints.WEBHOOK_TOKEN>}/github`;
|
|
4095
|
-
WEBHOOK_TOKEN_MESSAGE: (hookId: string, token: string, msgId: string) => `${ReturnType<typeof Endpoints.WEBHOOK_TOKEN>}/messages/{message_id}`;
|
|
4096
|
-
WEBHOOK_TOKEN_SLACK: (hookId: string, token: string) => `${ReturnType<typeof Endpoints.WEBHOOK_TOKEN>}/slack`;
|
|
4097
|
-
};
|
|
4098
|
-
|
|
4099
|
-
declare function graph(stateMachine: StateMachine): string;
|
|
4100
|
-
|
|
1
|
+
import AuditLogMethods = require("./methods/AuditLog");
|
|
2
|
+
import AutoModerationMethods = require("./methods/AutoModeration");
|
|
3
|
+
import BotMethods = require("./methods/Bot");
|
|
4
|
+
import ChannelMethods = require("./methods/Channel");
|
|
5
|
+
import AssetsMethods = require("./methods/Assets");
|
|
6
|
+
import EntitlementsMethods = require("./methods/Entitlements");
|
|
7
|
+
import GuildMethods = require("./methods/Guild");
|
|
8
|
+
import GuildScheduledEventMethods = require("./methods/GuildScheduledEvent");
|
|
9
|
+
import GuildTemplateMethods = require("./methods/GuildTemplate");
|
|
10
|
+
import InteractionMethods = require("./methods/Interaction");
|
|
11
|
+
import InviteMethods = require("./methods/Invite");
|
|
12
|
+
import SkuMethods = require("./methods/Sku");
|
|
13
|
+
import StageInstanceMethods = require("./methods/StageInstance");
|
|
14
|
+
import UserMethods = require("./methods/User");
|
|
15
|
+
import VoiceMethods = require("./methods/Voice");
|
|
16
|
+
import WebhookMethods = require("./methods/Webhook");
|
|
17
|
+
import tokenless = require("./tokenless");
|
|
18
|
+
import Constants = require("./Constants");
|
|
19
|
+
import Endpoints = require("./Endpoints");
|
|
20
|
+
import SnowTransfer = require("./SnowTransfer");
|
|
21
|
+
import StateMachine = require("./StateMachine");
|
|
22
|
+
import { graph } from "./StateMachineGraph";
|
|
4101
23
|
declare const graphWrapped: {
|
|
4102
24
|
graph: typeof graph;
|
|
4103
25
|
};
|
|
4104
|
-
|
|
4105
|
-
export
|
|
26
|
+
export * from "./Types";
|
|
27
|
+
export * from "./RequestHandler";
|
|
28
|
+
export { AuditLogMethods, AutoModerationMethods, BotMethods, ChannelMethods, AssetsMethods, EntitlementsMethods, GuildMethods, GuildScheduledEventMethods, GuildTemplateMethods, InteractionMethods, InviteMethods, SkuMethods, StageInstanceMethods, UserMethods, VoiceMethods, WebhookMethods, tokenless, Constants, Endpoints, SnowTransfer, StateMachine, graphWrapped as StateMachineGraph };
|