mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(core): missed optional options (#9311)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -98,7 +98,7 @@ export class GuildsAPI {
|
||||
* @param guildId - The id of the guild
|
||||
* @param options - The options for fetching the guild
|
||||
*/
|
||||
public async get(guildId: string, { signal }: Pick<RequestData, 'signal'>) {
|
||||
public async get(guildId: string, { signal }: Pick<RequestData, 'signal'> = {}) {
|
||||
return this.rest.get(Routes.guild(guildId), { signal }) as Promise<RESTGetAPIGuildResult>;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export class GuildsAPI {
|
||||
* @param guildId - The id of the guild to fetch the preview from
|
||||
* @param options - The options for fetching the guild preview
|
||||
*/
|
||||
public async getPreview(guildId: Snowflake, { signal }: Pick<RequestData, 'signal'>) {
|
||||
public async getPreview(guildId: Snowflake, { signal }: Pick<RequestData, 'signal'> = {}) {
|
||||
return this.rest.get(Routes.guildPreview(guildId), {
|
||||
signal,
|
||||
}) as Promise<RESTGetAPIGuildPreviewResult>;
|
||||
@@ -122,7 +122,7 @@ export class GuildsAPI {
|
||||
* @param body - The guild to create
|
||||
* @param options - The options for creating the guild
|
||||
*/
|
||||
public async create(body: RESTPostAPIGuildsJSONBody, { signal }: Pick<RequestData, 'signal'>) {
|
||||
public async create(body: RESTPostAPIGuildsJSONBody, { signal }: Pick<RequestData, 'signal'> = {}) {
|
||||
return this.rest.post(Routes.guilds(), { body, signal }) as Promise<RESTPostAPIGuildsResult>;
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ export class GuildsAPI {
|
||||
public async deleteRole(
|
||||
guildId: Snowflake,
|
||||
roleId: Snowflake,
|
||||
{ reason, signal }: Pick<RequestData, 'reason' | 'signal'>,
|
||||
{ reason, signal }: Pick<RequestData, 'reason' | 'signal'> = {},
|
||||
) {
|
||||
await this.rest.delete(Routes.guildRole(guildId, roleId), { reason, signal });
|
||||
}
|
||||
@@ -1129,7 +1129,7 @@ export class GuildsAPI {
|
||||
guildId: Snowflake,
|
||||
userId: Snowflake,
|
||||
roleId: Snowflake,
|
||||
{ reason, signal }: Pick<RequestData, 'reason' | 'signal'>,
|
||||
{ reason, signal }: Pick<RequestData, 'reason' | 'signal'> = {},
|
||||
) {
|
||||
await this.rest.delete(Routes.guildMemberRole(guildId, userId, roleId), { reason, signal });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user