Replace infraction types with static members

This commit is contained in:
nolan 2021-06-15 21:49:17 -07:00
parent 0dc63e1d97
commit 5563d1d2ef
16 changed files with 37 additions and 17 deletions

View File

@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
class AddroleInfraction extends Infraction { class AddroleInfraction extends Infraction {
static type = 'ADDROLE';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'ADDROLE',
targetType: 'USER', targetType: 'USER',
guild: opts.guild, guild: opts.guild,
channel: opts.channel, channel: opts.channel,

View File

@ -4,10 +4,11 @@ const { GuildMember } = require('../../extensions/');
class BanInfraction extends Infraction { class BanInfraction extends Infraction {
static type = 'BAN';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'BAN',
targetType: 'USER', targetType: 'USER',
guild: opts.guild, guild: opts.guild,
channel: opts.channel, channel: opts.channel,

View File

@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
class KickInfraction extends Infraction { class KickInfraction extends Infraction {
static type = 'KICK';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'KICK',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
class LockdownInfraction extends Infraction { class LockdownInfraction extends Infraction {
static type = 'LOCKDOWN';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'LOCKDOWN',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
class MuteInfraction extends Infraction { class MuteInfraction extends Infraction {
static type = 'MUTE';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'MUTE',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -10,10 +10,11 @@ const Constants = {
class NicknameInfraction extends Infraction { class NicknameInfraction extends Infraction {
static type = 'NICKNAME';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'NICKNAME',
targetType: 'USER', targetType: 'USER',
executor: opts.executor.user, executor: opts.executor.user,
target: opts.target.user, target: opts.target.user,

View File

@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
class NoteInfraction extends Infraction { class NoteInfraction extends Infraction {
static type = 'NOTE';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'NOTE',
targetType: 'USER', targetType: 'USER',
executor: opts.executor.user, executor: opts.executor.user,
target: opts.target.user, target: opts.target.user,

View File

@ -5,10 +5,11 @@ const Arguments = ['users', 'bots', 'humans', 'contains', 'startswith', 'endswit
class PruneInfraction extends Infraction { class PruneInfraction extends Infraction {
static type = 'PRUNE';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'PRUNE',
targetType: 'CHANNEL', targetType: 'CHANNEL',
message: opts.message, message: opts.message,
arguments: opts.arguments, arguments: opts.arguments,

View File

@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
class RemoveroleInfraction extends Infraction { class RemoveroleInfraction extends Infraction {
static type = 'REMOVEROLE';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'REMOVEROLE',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -3,10 +3,11 @@ const { Util } = require('../../../util/');
class SlowmodeInfraction extends Infraction { class SlowmodeInfraction extends Infraction {
static type = 'SLOWMODE';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'SLOWMODE',
targetType: 'CHANNEL', targetType: 'CHANNEL',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -3,10 +3,11 @@ const { GuildMember } = require('../../extensions/');
class SoftbanInfraction extends Infraction { class SoftbanInfraction extends Infraction {
static type = 'SOFTBAN';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'SOFTBAN',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
class UnbanInfraction extends Infraction { class UnbanInfraction extends Infraction {
static type = 'UNBAN';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'UNBAN',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
class UnlockdownInfraction extends Infraction { class UnlockdownInfraction extends Infraction {
static type = 'UNLOCKDOWN';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'UNLOCKDOWN',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
class UnmuteInfraction extends Infraction { class UnmuteInfraction extends Infraction {
static type = 'UNMUTE';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'UNMUTE',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
class VckickInfraction extends Infraction { class VckickInfraction extends Infraction {
static type = 'VCKICK';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'VCKICK',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,

View File

@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
class WarnInfraction extends Infraction { class WarnInfraction extends Infraction {
static type = 'WARN';
constructor(client, opts = {}) { constructor(client, opts = {}) {
super(client, { super(client, {
type: 'WARN',
targetType: 'USER', targetType: 'USER',
message: opts.message, message: opts.message,
executor: opts.executor.user, executor: opts.executor.user,
@ -40,6 +41,10 @@ class WarnInfraction extends Infraction {
} }
static get type() {
return 'WARN';
}
} }
module.exports = WarnInfraction; module.exports = WarnInfraction;