forked from Galactic/galactic-bot
50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
|
const { Command } = require('../../../../interfaces/');
|
||
|
|
||
|
class SettingCommand extends Command {
|
||
|
|
||
|
constructor(client) {
|
||
|
|
||
|
super(client, {
|
||
|
name: 'setting',
|
||
|
module: 'utility',
|
||
|
description: "Sets user or guild settings.",
|
||
|
aliases: [
|
||
|
'settings',
|
||
|
'set'
|
||
|
],
|
||
|
showUsage: true
|
||
|
});
|
||
|
|
||
|
this.client = client;
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
//-settings list
|
||
|
//-settings reset
|
||
|
//-settings walkthrough
|
||
|
//-settings [setting]
|
||
|
|
||
|
async execute(message, { params }) {
|
||
|
|
||
|
const target = params[0].toLowerCase(); // params[0] should never be null, see showUsage
|
||
|
if(target === 'list') {
|
||
|
this._listSettings(message);
|
||
|
return;
|
||
|
} else if(target === 'reset') {
|
||
|
const prompt = await this.message.prompt(message.format('C_SETTING_RESET'), { emoji: 'warning' });
|
||
|
return this._handleReset(prompt, message);
|
||
|
} else if(target === 'walkthrough') {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
const [ setting ] = this.client.resolver.components(params, 'setting', false);
|
||
|
if(!setting) {
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
module.exports = SettingCommand;
|