Files
discordeno/plugins/permissions/src/channels/getChannelWebhooks.ts
ITOH 7204665e77 fix(plugins): await old function return (#2065)
* fix(plugins): await old function return

* Update plugins/permissions/src/channels/stage.ts

lol

Co-authored-by: TriForMine <quentin.nicolini@hotmail.fr>

Co-authored-by: TriForMine <quentin.nicolini@hotmail.fr>
2022-02-15 20:06:06 +00:00

16 lines
521 B
TypeScript

import { BotWithCache } from "../../deps.ts";
import { requireBotChannelPermissions } from "../permissions.ts";
export default function getChannelWebhooks(bot: BotWithCache) {
const getChannelWebhooksOld = bot.helpers.getChannelWebhooks;
bot.helpers.getChannelWebhooks = async function (channelId) {
const channel = bot.channels.get(channelId);
if (channel?.guildId) {
requireBotChannelPermissions(bot, channelId, ["MANAGE_WEBHOOKS"]);
}
return await getChannelWebhooksOld(channelId);
};
}