mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
fix: configSchema in /docs endpoint
This commit is contained in:
parent
3b0a0b311d
commit
f3d64e2adc
1 changed files with 3 additions and 4 deletions
|
@ -121,8 +121,8 @@ export function initDocs(router: express.Router) {
|
|||
}
|
||||
|
||||
const plugin = guildPlugins.find((p) => p.name === name)!;
|
||||
const info = { ...baseInfo };
|
||||
delete info.configSchema;
|
||||
const { configSchema, ...info } = baseInfo;
|
||||
const formattedConfigSchema = formatZodConfigSchema(configSchema);
|
||||
|
||||
const messageCommands = (plugin.messageCommands || []).map((cmd) => ({
|
||||
trigger: cmd.trigger,
|
||||
|
@ -134,12 +134,11 @@ export function initDocs(router: express.Router) {
|
|||
}));
|
||||
|
||||
const defaultOptions = plugin.defaultOptions || {};
|
||||
const configSchema = info.configSchema && formatZodConfigSchema(info.configSchema);
|
||||
|
||||
res.json({
|
||||
name,
|
||||
info,
|
||||
configSchema,
|
||||
configSchema: formattedConfigSchema,
|
||||
defaultOptions,
|
||||
messageCommands,
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue