Port BotControl
This commit is contained in:
parent
b66e601cef
commit
f500034729
10 changed files with 237 additions and 2 deletions
|
@ -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();
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue