galactic-bot/structure/client/components/settings/developer/CamelCase.js

45 lines
1.1 KiB
JavaScript
Raw Normal View History

const { Setting } = require('../../../../interfaces/');
class CamelCaseSetting extends Setting {
constructor(client) {
super(client, {
name: 'camelCase',
module: 'developer',
resolve: 'USER',
default: {
camelCase: false
},
restricted: true,
archivable: false
});
}
async handle(message, params) {
const boolean = this.client.resolver.resolveBoolean(params.join(' '));
if(boolean === null) {
return {
msg: `Unable to parse boolean value.`,
error: true
};
}
await message.author._updateSettings({ [this.index]: boolean });
return {
msg: `Successfully set camelCase to \`${boolean}\`.`,
error: false
};
}
fields(user) {
return {
name: "》 Status",
2021-06-26 23:08:04 +02:00
value: user.format('SETTING_STATUS', { bool: Boolean(user._settings.camelCase) }, true)
};
}
}
module.exports = CamelCaseSetting;