2020-05-25 13:13:34 +02:00
|
|
|
const { Setting } = require('../../../../interfaces/');
|
|
|
|
|
|
|
|
class PremiumSetting extends Setting {
|
|
|
|
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: 'premium',
|
2020-07-04 12:23:10 +02:00
|
|
|
module: 'developer',
|
2020-05-25 13:13:34 +02:00
|
|
|
guarded: true,
|
|
|
|
resolve: 'GUILD',
|
|
|
|
default: {
|
|
|
|
premium: 0
|
|
|
|
},
|
|
|
|
archivable: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async handle(message, params) {
|
|
|
|
|
|
|
|
const [ type ] = params;
|
|
|
|
const int = parseInt(type);
|
|
|
|
|
|
|
|
if(!message.author.developer) return { error: true, ignore: true };
|
|
|
|
|
|
|
|
if(![0, 1, 2, 3].includes(int)) return {
|
2020-06-02 12:09:28 +02:00
|
|
|
msg: `Invalid premium type, must be \`0\`, \`1\`, \`2\`, or \`3\`.`,
|
2020-05-25 13:13:34 +02:00
|
|
|
error: true
|
|
|
|
};
|
|
|
|
|
|
|
|
await message.guild._updateSettings({ [this.index]: int });
|
|
|
|
return {
|
|
|
|
msg: `Successfully set the premium type to \`${int}\`.`,
|
|
|
|
error: false
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fields(guild) {
|
|
|
|
return {
|
2020-08-16 09:27:49 +02:00
|
|
|
name: "》 Premium",
|
2020-05-25 13:13:34 +02:00
|
|
|
value: `\`${guild.premium}\``
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = PremiumSetting;
|