mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 00:40:07 +00:00
17 lines
553 B
TypeScript
17 lines
553 B
TypeScript
import { BotWithCache } from "../../deps.ts";
|
|
import { requireBotChannelPermissions } from "../permissions.ts";
|
|
|
|
export default function deleteChannelOverwrite(bot: BotWithCache) {
|
|
const deleteChannelOverwriteOld = bot.helpers.deleteChannelOverwrite;
|
|
|
|
bot.helpers.deleteChannelOverwrite = function (channelId, overwriteId) {
|
|
const channel = bot.channels.get(channelId);
|
|
|
|
if (channel?.guildId) {
|
|
requireBotChannelPermissions(bot, channelId, ["MANAGE_ROLES"]);
|
|
}
|
|
|
|
return deleteChannelOverwriteOld(channelId, overwriteId);
|
|
};
|
|
}
|