mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: community requires admin closes #2088
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import { BotWithCache } from "../../deps.ts";
|
||||
import { BotWithCache, GuildFeatures } from "../../deps.ts";
|
||||
import { requireBotGuildPermissions } from "../permissions.ts";
|
||||
|
||||
export default function editGuild(bot: BotWithCache) {
|
||||
const editGuildOld = bot.helpers.editGuild;
|
||||
|
||||
bot.helpers.editGuild = async function (guildId, options, shardId) {
|
||||
requireBotGuildPermissions(bot, guildId, ["MANAGE_GUILD"]);
|
||||
if (options.features?.includes(GuildFeatures.Community)) {
|
||||
requireBotGuildPermissions(bot, guildId, ["ADMINISTRATOR"]);
|
||||
} else {
|
||||
requireBotGuildPermissions(bot, guildId, ["MANAGE_GUILD"]);
|
||||
}
|
||||
|
||||
return await editGuildOld(guildId, options, shardId);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user