Fix error when starring a post for starboard

This commit is contained in:
Dragory 2020-07-29 20:08:41 +03:00
parent dc25b67672
commit 49559c14fd
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 11 additions and 20 deletions

View file

@ -1,5 +1,5 @@
import { PluginOptions } from "knub";
import { ConfigSchema, StarboardPluginType } from "./types";
import { ConfigSchema, defaultStarboardOpts, StarboardPluginType } from "./types";
import { zeppelinPlugin } from "../ZeppelinPluginBlueprint";
import { trimPluginDescription } from "src/utils";
import { GuildSavedMessages } from "src/data/GuildSavedMessages";
@ -89,6 +89,16 @@ export const StarboardPlugin = zeppelinPlugin<StarboardPluginType>()("starboard"
`),
},
configPreprocessor(options) {
if (options.config?.boards) {
for (const [name, opts] of Object.entries(options.config.boards)) {
options.config.boards[name] = Object.assign({}, defaultStarboardOpts, options.config.boards[name]);
}
}
return options;
},
// prettier-ignore
commands: [
MigratePinsCmd,