mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
feat: add auth option in api methods (#10717)
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Denis-Adrian Cristea <didinele.dev@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -14,8 +14,13 @@ export class InvitesAPI {
|
||||
* @param query - The options for fetching the invite
|
||||
* @param options - The options for fetching the invite
|
||||
*/
|
||||
public async get(code: string, query: RESTGetAPIInviteQuery = {}, { signal }: Pick<RequestData, 'signal'> = {}) {
|
||||
public async get(
|
||||
code: string,
|
||||
query: RESTGetAPIInviteQuery = {},
|
||||
{ auth, signal }: Pick<RequestData, 'auth' | 'signal'> = {},
|
||||
) {
|
||||
return this.rest.get(Routes.invite(code), {
|
||||
auth,
|
||||
query: makeURLSearchParams(query),
|
||||
signal,
|
||||
}) as Promise<RESTGetAPIInviteResult>;
|
||||
@@ -28,7 +33,7 @@ export class InvitesAPI {
|
||||
* @param code - The invite code
|
||||
* @param options - The options for deleting the invite
|
||||
*/
|
||||
public async delete(code: string, { reason, signal }: Pick<RequestData, 'reason' | 'signal'> = {}) {
|
||||
await this.rest.delete(Routes.invite(code), { reason, signal });
|
||||
public async delete(code: string, { auth, reason, signal }: Pick<RequestData, 'auth' | 'reason' | 'signal'> = {}) {
|
||||
await this.rest.delete(Routes.invite(code), { auth, reason, signal });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user