mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 01:10: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>
15 lines
419 B
TypeScript
15 lines
419 B
TypeScript
import { BotWithCache } from "../../deps.ts";
|
|
|
|
export default function deleteGuild(bot: BotWithCache) {
|
|
const deleteGuildOld = bot.helpers.deleteGuild;
|
|
|
|
bot.helpers.deleteGuild = async function (guildId) {
|
|
const guild = bot.guilds.get(guildId);
|
|
if (guild && guild.ownerId !== bot.id) {
|
|
throw new Error("A bot can only delete a guild it owns.");
|
|
}
|
|
|
|
return await deleteGuildOld(guildId);
|
|
};
|
|
}
|