3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00

fix: allow servers with button_groups in their reaction_roles config to load with a warning

This commit is contained in:
Dragory 2022-04-23 23:26:16 +03:00
parent 44d68bf608
commit d93097306c
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 8 additions and 5 deletions

View file

@ -68,11 +68,12 @@ export const ReactionRolesPlugin = zeppelinGuildPlugin<ReactionRolesPluginType>(
},
afterLoad(pluginData) {
// let autoRefreshInterval = pluginData.config.get().auto_refresh_interval;
// if (autoRefreshInterval != null) {
// autoRefreshInterval = Math.max(MIN_AUTO_REFRESH, autoRefreshInterval);
// autoRefreshLoop(pluginData, autoRefreshInterval);
// }
const config = pluginData.config.get();
if (config.button_groups) {
pluginData.getPlugin(LogsPlugin).logBotAlert({
body: "The 'button_groups' option of the 'reaction_roles' plugin is deprecated and non-functional. Consider using the new 'role_buttons' plugin instead!",
});
}
},
beforeUnload(pluginData) {

View file

@ -3,11 +3,13 @@ import { BasePluginType, typedGuildCommand, typedGuildEventListener } from "knub
import { GuildReactionRoles } from "../../data/GuildReactionRoles";
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
import { Queue } from "../../Queue";
import { tNullable } from "../../utils";
export const ConfigSchema = t.type({
auto_refresh_interval: t.number,
remove_user_reactions: t.boolean,
can_manage: t.boolean,
button_groups: tNullable(t.unknown),
});
export type TConfigSchema = t.TypeOf<typeof ConfigSchema>;