aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/blacklist
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors/blacklist')
-rw-r--r--src/inhibitors/blacklist/channelGlobalBlacklist.ts12
-rw-r--r--src/inhibitors/blacklist/channelGuildBlacklist.ts12
-rw-r--r--src/inhibitors/blacklist/guildBlacklist.ts12
-rw-r--r--src/inhibitors/blacklist/userGlobalBlacklist.ts12
-rw-r--r--src/inhibitors/blacklist/userGuildBlacklist.ts12
5 files changed, 30 insertions, 30 deletions
diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
index 988931b..a212606 100644
--- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
@@ -1,21 +1,21 @@
-import { BotInhibitor, type BotCommand, type CommandMessage, type SlashMessage } from '#lib';
+import { BotInhibitor, InhibitorReason, InhibitorType, type BotCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class UserGlobalBlacklistInhibitor extends BotInhibitor {
public constructor() {
- super('channelGlobalBlacklist', {
- reason: 'channelGlobalBlacklist',
- type: 'post',
+ super(InhibitorReason.ChannelGlobalBlacklist, {
+ reason: InhibitorReason.ChannelGlobalBlacklist,
+ type: InhibitorType.Post,
priority: 500
});
}
public exec(message: CommandMessage | SlashMessage, command: BotCommand): boolean {
if (!message.author || !message.inGuild()) return false;
- // do not change to message.author.isOwner()
+ //! do not change to message.author.isOwner()
if (this.client.isOwner(message.author) || this.client.user!.id === message.author.id) return false;
if (this.client.cache.global.blacklistedChannels.includes(message.channel!.id) && !command.bypassChannelBlacklist) {
void this.client.console.verbose(
- 'channelGlobalBlacklist',
+ InhibitorReason.ChannelGlobalBlacklist,
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);
return true;
diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts
index 4bf42d2..ec81666 100644
--- a/src/inhibitors/blacklist/channelGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts
@@ -1,17 +1,17 @@
-import { BotInhibitor, type BotCommand, type CommandMessage, type SlashMessage } from '#lib';
+import { BotInhibitor, InhibitorReason, InhibitorType, type BotCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class ChannelGuildBlacklistInhibitor extends BotInhibitor {
public constructor() {
- super('channelGuildBlacklist', {
- reason: 'channelGuildBlacklist',
- type: 'post',
+ super(InhibitorReason.ChannelGuildBlacklist, {
+ reason: InhibitorReason.ChannelGuildBlacklist,
+ type: InhibitorType.Post,
priority: 499
});
}
public async exec(message: CommandMessage | SlashMessage, command: BotCommand): Promise<boolean> {
if (!message.author || !message.inGuild()) return false;
- // do not change to message.author.isOwner()
+ //! do not change to message.author.isOwner()
if (this.client.isOwner(message.author) || this.client.user!.id === message.author.id) return false;
if (
(await message.guild.getSetting('bypassChannelBlacklist'))?.includes(message.author.id) &&
@@ -24,7 +24,7 @@ export default class ChannelGuildBlacklistInhibitor extends BotInhibitor {
!command.bypassChannelBlacklist
) {
void this.client.console.verbose(
- 'channelGuildBlacklist',
+ InhibitorReason.ChannelGuildBlacklist,
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);
return true;
diff --git a/src/inhibitors/blacklist/guildBlacklist.ts b/src/inhibitors/blacklist/guildBlacklist.ts
index 636d0a3..b1f1543 100644
--- a/src/inhibitors/blacklist/guildBlacklist.ts
+++ b/src/inhibitors/blacklist/guildBlacklist.ts
@@ -1,17 +1,17 @@
-import { BotInhibitor, type CommandMessage, type SlashMessage } from '#lib';
+import { BotInhibitor, InhibitorReason, InhibitorType, type CommandMessage, type SlashMessage } from '#lib';
export default class GuildBlacklistInhibitor extends BotInhibitor {
public constructor() {
- super('guildBlacklist', {
- reason: 'guildBlacklist',
- type: 'all',
+ super(InhibitorReason.GuildBlacklist, {
+ reason: InhibitorReason.GuildBlacklist,
+ type: InhibitorType.All,
priority: 50
});
}
public exec(message: CommandMessage | SlashMessage): boolean {
if (!message.author || !message.inGuild()) return false;
- // do not change to message.author.isOwner()
+ //! do not change to message.author.isOwner()
if (
this.client.isOwner(message.author) ||
this.client.isSuperUser(message.author) ||
@@ -20,7 +20,7 @@ export default class GuildBlacklistInhibitor extends BotInhibitor {
return false;
if (this.client.cache.global.blacklistedGuilds.includes(message.guild.id)) {
void this.client.console.verbose(
- 'guildBlacklist',
+ InhibitorReason.GuildBlacklist,
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);
return true;
diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts
index f5b15df..b0eacfc 100644
--- a/src/inhibitors/blacklist/userGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts
@@ -1,21 +1,21 @@
-import { BotInhibitor, type CommandMessage, type SlashMessage } from '#lib';
+import { BotInhibitor, InhibitorReason, InhibitorType, type CommandMessage, type SlashMessage } from '#lib';
export default class UserGlobalBlacklistInhibitor extends BotInhibitor {
public constructor() {
- super('userGlobalBlacklist', {
- reason: 'userGlobalBlacklist',
- type: 'pre',
+ super(InhibitorReason.UserGlobalBlacklist, {
+ reason: InhibitorReason.UserGlobalBlacklist,
+ type: InhibitorType.Pre,
priority: 30
});
}
public exec(message: CommandMessage | SlashMessage): boolean {
if (!message.author) return false;
- // do not change to message.author.isOwner()
+ //! do not change to message.author.isOwner()
if (this.client.isOwner(message.author) || this.client.user!.id === message.author.id) return false;
if (this.client.cache.global.blacklistedUsers.includes(message.author.id)) {
void this.client.console.verbose(
- 'userGlobalBlacklist',
+ InhibitorReason.UserGlobalBlacklist,
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${
message.inGuild() ? message.guild?.name : message.author.tag
}>>.`
diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts
index 3186d59..4330f87 100644
--- a/src/inhibitors/blacklist/userGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/userGuildBlacklist.ts
@@ -1,17 +1,17 @@
-import { BotInhibitor, type CommandMessage, type SlashMessage } from '#lib';
+import { BotInhibitor, InhibitorReason, InhibitorType, type CommandMessage, type SlashMessage } from '#lib';
export default class UserGuildBlacklistInhibitor extends BotInhibitor {
public constructor() {
- super('userGuildBlacklist', {
- reason: 'userGuildBlacklist',
- type: 'pre',
+ super(InhibitorReason.UserGuildBlacklist, {
+ reason: InhibitorReason.UserGuildBlacklist,
+ type: InhibitorType.Pre,
priority: 20
});
}
public async exec(message: CommandMessage | SlashMessage): Promise<boolean> {
if (!message.author || !message.inGuild()) return false;
- // do not change to message.author.isOwner()
+ //! do not change to message.author.isOwner()
if (
this.client.isOwner(message.author) ||
this.client.isSuperUser(message.author) ||
@@ -20,7 +20,7 @@ export default class UserGuildBlacklistInhibitor extends BotInhibitor {
return false;
if ((await message.guild.getSetting('blacklistedUsers'))?.includes(message.author.id)) {
void this.client.console.verbose(
- 'userGuildBlacklist',
+ InhibitorReason.UserGuildBlacklist,
`Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`
);
return true;