mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 08:50:07 +00:00
* 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>
28 lines
829 B
TypeScript
28 lines
829 B
TypeScript
import { BotWithCache } from "../deps.ts";
|
|
import { requireBotGuildPermissions } from "./permissions.ts";
|
|
|
|
export function deleteIntegration(bot: BotWithCache) {
|
|
const deleteIntegrationOld = bot.helpers.deleteIntegration;
|
|
|
|
bot.helpers.deleteIntegration = async function (guildId, id) {
|
|
requireBotGuildPermissions(bot, guildId, ["MANAGE_GUILD"]);
|
|
|
|
return await deleteIntegrationOld(guildId, id);
|
|
};
|
|
}
|
|
|
|
export function getIntegrations(bot: BotWithCache) {
|
|
const getIntegrationsOld = bot.helpers.getIntegrations;
|
|
|
|
bot.helpers.getIntegrations = async function (guildId) {
|
|
requireBotGuildPermissions(bot, guildId, ["MANAGE_GUILD"]);
|
|
|
|
return await getIntegrationsOld(guildId);
|
|
};
|
|
}
|
|
|
|
export default function setupIntegrationPermChecks(bot: BotWithCache) {
|
|
deleteIntegration(bot);
|
|
getIntegrations(bot);
|
|
}
|