Replace infraction types with static members
This commit is contained in:
parent
0dc63e1d97
commit
5563d1d2ef
@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class AddroleInfraction extends Infraction {
|
||||
|
||||
static type = 'ADDROLE';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'ADDROLE',
|
||||
targetType: 'USER',
|
||||
guild: opts.guild,
|
||||
channel: opts.channel,
|
||||
|
@ -4,10 +4,11 @@ const { GuildMember } = require('../../extensions/');
|
||||
|
||||
class BanInfraction extends Infraction {
|
||||
|
||||
static type = 'BAN';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'BAN',
|
||||
targetType: 'USER',
|
||||
guild: opts.guild,
|
||||
channel: opts.channel,
|
||||
|
@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class KickInfraction extends Infraction {
|
||||
|
||||
static type = 'KICK';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
|
||||
super(client, {
|
||||
type: 'KICK',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class LockdownInfraction extends Infraction {
|
||||
|
||||
static type = 'LOCKDOWN';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'LOCKDOWN',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class MuteInfraction extends Infraction {
|
||||
|
||||
static type = 'MUTE';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'MUTE',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -10,10 +10,11 @@ const Constants = {
|
||||
|
||||
class NicknameInfraction extends Infraction {
|
||||
|
||||
static type = 'NICKNAME';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'NICKNAME',
|
||||
targetType: 'USER',
|
||||
executor: opts.executor.user,
|
||||
target: opts.target.user,
|
||||
|
@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class NoteInfraction extends Infraction {
|
||||
|
||||
static type = 'NOTE';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'NOTE',
|
||||
targetType: 'USER',
|
||||
executor: opts.executor.user,
|
||||
target: opts.target.user,
|
||||
|
@ -5,10 +5,11 @@ const Arguments = ['users', 'bots', 'humans', 'contains', 'startswith', 'endswit
|
||||
|
||||
class PruneInfraction extends Infraction {
|
||||
|
||||
static type = 'PRUNE';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'PRUNE',
|
||||
targetType: 'CHANNEL',
|
||||
message: opts.message,
|
||||
arguments: opts.arguments,
|
||||
|
@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class RemoveroleInfraction extends Infraction {
|
||||
|
||||
static type = 'REMOVEROLE';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'REMOVEROLE',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -3,10 +3,11 @@ const { Util } = require('../../../util/');
|
||||
|
||||
class SlowmodeInfraction extends Infraction {
|
||||
|
||||
static type = 'SLOWMODE';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'SLOWMODE',
|
||||
targetType: 'CHANNEL',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -3,10 +3,11 @@ const { GuildMember } = require('../../extensions/');
|
||||
|
||||
class SoftbanInfraction extends Infraction {
|
||||
|
||||
static type = 'SOFTBAN';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'SOFTBAN',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class UnbanInfraction extends Infraction {
|
||||
|
||||
static type = 'UNBAN';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'UNBAN',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class UnlockdownInfraction extends Infraction {
|
||||
|
||||
static type = 'UNLOCKDOWN';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'UNLOCKDOWN',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -3,10 +3,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class UnmuteInfraction extends Infraction {
|
||||
|
||||
static type = 'UNMUTE';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'UNMUTE',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class VckickInfraction extends Infraction {
|
||||
|
||||
static type = 'VCKICK';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'VCKICK',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
|
@ -2,10 +2,11 @@ const { Infraction } = require('../interfaces/');
|
||||
|
||||
class WarnInfraction extends Infraction {
|
||||
|
||||
static type = 'WARN';
|
||||
|
||||
constructor(client, opts = {}) {
|
||||
|
||||
super(client, {
|
||||
type: 'WARN',
|
||||
targetType: 'USER',
|
||||
message: opts.message,
|
||||
executor: opts.executor.user,
|
||||
@ -40,6 +41,10 @@ class WarnInfraction extends Infraction {
|
||||
|
||||
}
|
||||
|
||||
static get type() {
|
||||
return 'WARN';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = WarnInfraction;
|
Loading…
Reference in New Issue
Block a user