mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +01:00
fix(guild)!: Remove API related to guild ownership (#11029)
* fix(guild): deprecate guild owner API * style: prettier
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
import { makeURLSearchParams, type RawFile, type REST, type RequestData } from '@discordjs/rest';
|
import { makeURLSearchParams, type RawFile, type REST, type RequestData } from '@discordjs/rest';
|
||||||
import {
|
import {
|
||||||
Routes,
|
Routes,
|
||||||
type GuildMFALevel,
|
|
||||||
type GuildWidgetStyle,
|
type GuildWidgetStyle,
|
||||||
type RESTGetAPIAuditLogQuery,
|
type RESTGetAPIAuditLogQuery,
|
||||||
type RESTGetAPIAuditLogResult,
|
type RESTGetAPIAuditLogResult,
|
||||||
@@ -89,7 +88,6 @@ import {
|
|||||||
type RESTPostAPIGuildStickerResult,
|
type RESTPostAPIGuildStickerResult,
|
||||||
type RESTPostAPIGuildTemplatesJSONBody,
|
type RESTPostAPIGuildTemplatesJSONBody,
|
||||||
type RESTPostAPIGuildTemplatesResult,
|
type RESTPostAPIGuildTemplatesResult,
|
||||||
type RESTPostAPIGuildsMFAResult,
|
|
||||||
type RESTPutAPIGuildBanJSONBody,
|
type RESTPutAPIGuildBanJSONBody,
|
||||||
type RESTPutAPIGuildMemberJSONBody,
|
type RESTPutAPIGuildMemberJSONBody,
|
||||||
type RESTPutAPIGuildMemberResult,
|
type RESTPutAPIGuildMemberResult,
|
||||||
@@ -167,17 +165,6 @@ export class GuildsAPI {
|
|||||||
}) as Promise<RESTPatchAPIGuildResult>;
|
}) as Promise<RESTPatchAPIGuildResult>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Deletes a guild
|
|
||||||
*
|
|
||||||
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
|
|
||||||
* @param guildId - The id of the guild to delete
|
|
||||||
* @param options - The options for deleting this guild
|
|
||||||
*/
|
|
||||||
public async delete(guildId: Snowflake, { auth, signal }: Pick<RequestData, 'auth' | 'signal'> = {}) {
|
|
||||||
await this.rest.delete(Routes.guild(guildId), { auth, signal });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds user to the guild
|
* Adds user to the guild
|
||||||
*
|
*
|
||||||
@@ -481,27 +468,6 @@ export class GuildsAPI {
|
|||||||
await this.rest.delete(Routes.guildRole(guildId, roleId), { auth, reason, signal });
|
await this.rest.delete(Routes.guildRole(guildId, roleId), { auth, reason, signal });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Edits the multi-factor-authentication (MFA) level of a guild
|
|
||||||
*
|
|
||||||
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level}
|
|
||||||
* @param guildId - The id of the guild to edit the MFA level for
|
|
||||||
* @param level - The new MFA level
|
|
||||||
* @param options - The options for editing the MFA level
|
|
||||||
*/
|
|
||||||
public async editMFALevel(
|
|
||||||
guildId: Snowflake,
|
|
||||||
level: GuildMFALevel,
|
|
||||||
{ auth, reason, signal }: Pick<RequestData, 'auth' | 'reason' | 'signal'> = {},
|
|
||||||
) {
|
|
||||||
return this.rest.post(Routes.guildMFA(guildId), {
|
|
||||||
auth,
|
|
||||||
reason,
|
|
||||||
signal,
|
|
||||||
body: { level },
|
|
||||||
}) as Promise<RESTPostAPIGuildsMFAResult>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch the number of members that can be pruned from a guild
|
* Fetch the number of members that can be pruned from a guild
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user