mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
feat:add modifyGuildMfaLevel (#2416)
* add modifyGuildMfaLevel * plugins/permissions: editGuildMfaLevel * tests/guilds: editGuildMfaLevel * helpers/guilds: editGuuldMfaLevel return void * editGuildMfaLevel return void * Update plugins/permissions/src/guilds/editGuildMfaLevel.ts * tests/guilds: fix editGuildMfaLevel CACHED_COMMUNITY_GUILD_ID is not owned by the bot Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
co-authored by
Skillz4Killz
parent
15f34f6d17
commit
ec91822a73
@@ -0,0 +1,11 @@
|
||||
import { BotWithCache } from "../../deps.ts";
|
||||
|
||||
export default function editGuildMfaLevel(bot: BotWithCache) {
|
||||
const editGuildMfaLevelOld = bot.helpers.editGuildMfaLevel;
|
||||
|
||||
bot.helpers.editGuildMfaLevel = async function (guildId, mfaLevel, reason) {
|
||||
const guild = bot.guilds.get(guildId);
|
||||
if (guild?.ownerId !== bot.id) throw new Error("The bot is not the owner of the guild");
|
||||
return await editGuildMfaLevelOld(guildId, mfaLevel, reason);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user