2020-10-01 01:43:38 +03:00
|
|
|
import { botControlCmd } from "../types";
|
2020-07-30 03:21:07 +03:00
|
|
|
import { isOwnerPreFilter } from "../../../pluginUtils";
|
|
|
|
import { getActiveReload, setActiveReload } from "../activeReload";
|
|
|
|
import { TextChannel } from "eris";
|
|
|
|
|
2020-10-01 01:43:38 +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.createMessage("Reloading global plugins...");
|
|
|
|
|
|
|
|
pluginData.getKnubInstance().reloadAllGlobalPlugins();
|
|
|
|
},
|
|
|
|
});
|