mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(guild): add support for setting MFA level (#8024)
This commit is contained in:
@@ -1138,6 +1138,22 @@ class Guild extends AnonymousGuild {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the guild's MFA level
|
||||
* @param {GuildMFALevel} level The MFA level
|
||||
* @param {string} [reason] Reason for changing the guild's MFA level
|
||||
* @returns {Promise<Guild>}
|
||||
*/
|
||||
async setMFALevel(level, reason) {
|
||||
await this.client.rest.post(Routes.guildMFA(this.id), {
|
||||
body: {
|
||||
level,
|
||||
},
|
||||
reason,
|
||||
});
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Leaves the guild.
|
||||
* @returns {Promise<Guild>}
|
||||
|
||||
1
packages/discord.js/typings/index.d.ts
vendored
1
packages/discord.js/typings/index.d.ts
vendored
@@ -1167,6 +1167,7 @@ export class Guild extends AnonymousGuild {
|
||||
public setVerificationLevel(verificationLevel: GuildVerificationLevel | null, reason?: string): Promise<Guild>;
|
||||
public setPremiumProgressBarEnabled(enabled?: boolean, reason?: string): Promise<Guild>;
|
||||
public setWidgetSettings(settings: GuildWidgetSettingsData, reason?: string): Promise<Guild>;
|
||||
public setMFALevel(level: GuildMFALevel, reason?: string): Promise<Guild>;
|
||||
public toJSON(): unknown;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user