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:
LTS20050703
2022-09-08 11:13:19 -05:00
committed by GitHub
co-authored by Skillz4Killz
parent 15f34f6d17
commit ec91822a73
5 changed files with 39 additions and 2 deletions
@@ -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);
};
}