Files
discordeno/plugins/permissions/src/webhooks/deleteWebhook.ts
T
2022-01-26 19:02:34 +01:00

13 lines
417 B
TypeScript

import { BotWithCache } from "../../deps.ts";
import { requireBotChannelPermissions } from "../permissions.ts";
export default function deleteWebhook(bot: BotWithCache) {
const deleteWebhookOld = bot.helpers.deleteWebhook;
bot.helpers.deleteWebhook = function (channelId, options) {
requireBotChannelPermissions(bot, channelId, ["MANAGE_WEBHOOKS"]);
return deleteWebhookOld(channelId, options);
};
}