2020-07-04 12:23:10 +02:00
|
|
|
const { Setting } = require('../../../../interfaces/');
|
|
|
|
|
|
|
|
class DebugSetting extends Setting {
|
|
|
|
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: 'debug',
|
|
|
|
module: 'developer',
|
|
|
|
guarded: true,
|
|
|
|
resolve: 'GUILD',
|
|
|
|
default: {
|
|
|
|
debug: false
|
|
|
|
},
|
|
|
|
archivable: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async handle(message, params) {
|
|
|
|
|
|
|
|
if(!message.author.developer) return { error: true, ignore: true };
|
|
|
|
|
|
|
|
const parameters = params.join(' ');
|
|
|
|
const boolean = this.client.resolver.resolveBoolean(parameters);
|
|
|
|
if(boolean === null) return {
|
|
|
|
msg: `The argument provided is not a boolean value. *(__t__rue, __f__alse)*`,
|
|
|
|
error: true
|
|
|
|
};
|
|
|
|
|
|
|
|
await message.guild._updateSettings({
|
|
|
|
[this.index]: boolean
|
|
|
|
});
|
|
|
|
|
|
|
|
return {
|
|
|
|
msg: `Successfully set the debugging to \`${boolean}\`.`,
|
|
|
|
error: false
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fields(guild) {
|
|
|
|
return {
|
2020-08-16 09:27:49 +02:00
|
|
|
name: "》 Debugging",
|
|
|
|
value: guild.format('SETTING_STATUS', { bool: Boolean(guild.debug) }, true)
|
2020-07-04 12:23:10 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = DebugSetting;
|