3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 16:25:03 +00:00

refactor: Upped default status limit to 32 chars

This commit is contained in:
Jonathan 2021-04-06 02:54:01 -04:00
parent e8f1ea024b
commit e6ae893f26
No known key found for this signature in database
GPG key ID: 19B04E3CBE0885B1
2 changed files with 5 additions and 5 deletions

View file

@ -13,7 +13,7 @@ const defaultOptions: PluginOptions<AFKPluginType> = {
can_afk: false, can_afk: false,
allow_links: false, allow_links: false,
allow_invites: false, allow_invites: false,
max_status_limit: 12 max_status_limit: 32
}, },
overrides: [ overrides: [
{ {
@ -22,7 +22,7 @@ const defaultOptions: PluginOptions<AFKPluginType> = {
can_afk: true, can_afk: true,
allow_links: true, allow_links: true,
allow_invites: true, allow_invites: true,
max_status_limit: 12, max_status_limit: 32,
} }
} }
] ]
@ -31,8 +31,8 @@ const defaultOptions: PluginOptions<AFKPluginType> = {
const configPreprocessor: ConfigPreprocessorFn<AFKPluginType> = options => { const configPreprocessor: ConfigPreprocessorFn<AFKPluginType> = options => {
if (options.config.max_status_limit) { if (options.config.max_status_limit) {
const max_limit = options.config.max_status_limit; const max_limit = options.config.max_status_limit;
if (max_limit > 24) throw new StrictValidationError([ if (max_limit > 32) throw new StrictValidationError([
`max_status_limit needs to be under 24 characters.` `max_status_limit needs to be under 32 characters.`
]); ]);
} }
return options; return options;

View file

@ -19,7 +19,7 @@ export const AfkSetCmd = afkCmd({
const status = args.status.join(" "); const status = args.status.join(" ");
// Check status length // Check status length
const maxStatusLength = pluginData.config.getForMember(msg.member).max_status_limit ?? 12; const maxStatusLength = pluginData.config.getForMember(msg.member).max_status_limit ?? 32;
if (status.length > maxStatusLength) { if (status.length > maxStatusLength) {
sendErrorMessage(pluginData, msg.channel, `Status length is above **${maxStatusLength}** characters.`); sendErrorMessage(pluginData, msg.channel, `Status length is above **${maxStatusLength}** characters.`);
return; return;