3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-19 07:20:00 +00:00
zeppelin/backend/src/plugins/BotControl/commands/ReloadGlobalPluginsCmd.ts

22 lines
667 B
TypeScript
Raw Normal View History

import { botControlCmd } from "../types";
2020-07-30 03:21:07 +03:00
import { isOwnerPreFilter } from "../../../pluginUtils";
import { getActiveReload, setActiveReload } from "../activeReload";
import { TextChannel } from "discord.js";
2020-07-30 03:21:07 +03:00
export const ReloadGlobalPluginsCmd = botControlCmd({
2020-07-30 03:21:07 +03:00
trigger: "bot_reload_global_plugins",
permission: null,
config: {
preFilters: [isOwnerPreFilter],
},
async run({ pluginData, message }) {
if (getActiveReload()) return;
setActiveReload((message.channel as TextChannel).guild?.id, message.channel.id);
await message.channel.send("Reloading global plugins...");
2020-07-30 03:21:07 +03:00
pluginData.getKnubInstance().reloadGlobalContext();
2020-07-30 03:21:07 +03:00
},
});