Tweaks to availablePlugins types
This commit is contained in:
parent
ae2f2516eb
commit
b6257b9189
2 changed files with 5 additions and 4 deletions
|
@ -48,7 +48,7 @@ export function initDocs(app: express.Express) {
|
|||
|
||||
app.get("/docs/plugins/:pluginName", (req: express.Request, res: express.Response) => {
|
||||
// prettier-ignore
|
||||
const plugin = docsPlugins.find(obj => getPluginName(obj) === req.params.pluginName) as ZeppelinPluginBlueprint<any>;
|
||||
const plugin = docsPlugins.find(obj => getPluginName(obj) === req.params.pluginName);
|
||||
if (!plugin) {
|
||||
return notFound(res);
|
||||
}
|
||||
|
@ -56,13 +56,13 @@ export function initDocs(app: express.Express) {
|
|||
const name = getPluginName(plugin);
|
||||
const info = plugin.info || {};
|
||||
|
||||
const commands = plugin.commands.map(cmd => ({
|
||||
const commands = (plugin.commands || []).map(cmd => ({
|
||||
trigger: cmd.trigger,
|
||||
signature: cmd.signature,
|
||||
config: cmd.config,
|
||||
}));
|
||||
|
||||
const defaultOptions = plugin.defaultOptions;
|
||||
const defaultOptions = plugin.defaultOptions || {};
|
||||
const configSchema = plugin.configSchema && formatConfigSchema(plugin.configSchema);
|
||||
|
||||
res.json({
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import { UtilityPlugin } from "./Utility/UtilityPlugin";
|
||||
import { LocateUserPlugin } from "./LocateUser/LocateUserPlugin";
|
||||
import { ZeppelinPluginBlueprint } from "./ZeppelinPluginBlueprint";
|
||||
|
||||
// prettier-ignore
|
||||
export const guildPlugins = [
|
||||
export const guildPlugins: Array<ZeppelinPluginBlueprint<any>> = [
|
||||
LocateUserPlugin,
|
||||
UtilityPlugin,
|
||||
];
|
||||
|
|
Loading…
Add table
Reference in a new issue