misc fixes

This commit is contained in:
Erik 2020-07-11 23:11:37 +03:00
parent badbafa844
commit 5b9382b529

View File

@ -34,14 +34,13 @@ class WelcomerSetting extends Setting {
const { guild } = message;
const setting = guild._settings[this.index] || this.default[this.index];
const { resolver } = this.client;
const response = await resolver.resolveMethod(params);
const langParams = {};
let index = null;
if(resolver.resolveBoolean(params[0]) !== null) {
setting.enabled = resolver.resolveBoolean(params[0]);
index = 'S_WELCOMER_TOGGLE';
langParams.toggle = message.format('ON_OFF_TOGGLE', { toggle: setting.enabled }, true)
langParams.toggle = message.format('ON_OFF_TOGGLE', { toggle: setting.enabled }, true);
} else {
setting.message = message.content.replace(guild.prefix, '').replace(message._caller, '').replace(message._settingCaller, '').trim();
index = 'S_WELCOMER_SET';
@ -66,10 +65,10 @@ class WelcomerSetting extends Setting {
},
{
name: '》Message',
value: setting.message.substring(0,1021) + setting.message.length > 1021 ? '...' : '',
value: `\`${setting.message.substring(0, 1021)}${setting.message.length > 1021 ? '...' : ''}\``,
inline: false
}
]
];
}
}