Port BotControl

This commit is contained in:
Dragory 2020-07-30 03:21:07 +03:00
parent b66e601cef
commit f500034729
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
10 changed files with 237 additions and 2 deletions

View file

@ -0,0 +1,22 @@
import { command } from "knub";
import { BotControlPluginType } from "../types";
import { isOwnerPreFilter } from "../../../pluginUtils";
import { getActiveReload, setActiveReload } from "../activeReload";
import { TextChannel } from "eris";
export const ReloadGlobalPluginsCmd = command<BotControlPluginType>()({
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();
},
});