const { Setting } = require('../../../../interfaces'); const Constants = { Infractions: [ 'NOTE', 'WARN', 'MUTE', 'UNMUTE', 'KICK', 'SOFTBAN', 'BAN', 'UNBAN', 'VCMUTE', 'VCUNMUTE', 'VCKICK', 'VCBAN', 'VCUNBAN', 'REMOVEROLE', 'ADDROLE', 'NICKNAME' ] }; class DmInfractionSetting extends Setting { constructor(client) { super(client, { name: 'dmInfraction', module: 'logging', aliases: [ 'directMessageInfraction', 'privateLog', 'dmLog'// idk... ], usage: " ", examples: [ "dmInfraction off", "dmInfraction - warning mute", "dmInfraction default You have been {infraction-past} in the server {servername}.", "dmInfraction ban You have been banned! If you would like to appeal this ban, please visit this link: https://google.com/" ], default: { dmInfraction: { enabled: false, infractions: ['WARN', 'MUTE', 'UNMUTE', 'KICK', 'SOFTBAN', 'BAN', 'UNBAN', 'VCMUTE', 'VCUNMUTE', 'VCKICK', 'VCBAN', 'VCUNBAN'], messages: { default: "You were **{infraction}** {from|on} the server `{server}`, your infraction details are below." //BAN: etc } } }, archivable: false }); } async handle(message, args) { const setting = message.guild._settings[this.index]; const boolean = this.client.resolver.resolveBoolean(args.join(' ')); if(boolean !== null) { await message.guild._updateSettings({ [this.index]: { ...setting, enabled: boolean } }); return { msg: message.format('S_DMINFRACTION_TOGGLESUCCESS', { boolean: message.format('SETTING_ENABLEDISABLE', { bool: boolean }, { code: true }) }), error: false }; } // const result = this.client.resolver.list( // setting.infractions, // Constants.Infractions, // args, // this.client.resolver.resolveInfractions.bind(this.client.resolver) // ); // if(result) { // const method = // } } async fields(guild) { const setting = guild._settings[this.index]; return [ { name: '》 Status', value: guild.format('SETTING_STATUS', { bool: Boolean(setting?.enabled) }, true), inline: true } ]; } } module.exports = DmInfractionSetting;