aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors')
-rw-r--r--src/inhibitors/blacklist/channelGlobalBlacklist.ts1
-rw-r--r--src/inhibitors/blacklist/channelGuildBlacklist.ts1
-rw-r--r--src/inhibitors/blacklist/guildBlacklist.ts1
-rw-r--r--src/inhibitors/blacklist/userGlobalBlacklist.ts1
-rw-r--r--src/inhibitors/blacklist/userGuildBlacklist.ts1
-rw-r--r--src/inhibitors/checks/fatal.ts1
-rw-r--r--src/inhibitors/checks/guildUnavailable.ts1
-rw-r--r--src/inhibitors/command/dm.ts1
-rw-r--r--src/inhibitors/command/globalDisabledCommand.ts1
-rw-r--r--src/inhibitors/command/guild.ts1
-rw-r--r--src/inhibitors/command/guildDisabledCommand.ts1
-rw-r--r--src/inhibitors/command/nsfw.ts1
-rw-r--r--src/inhibitors/command/owner.ts1
-rw-r--r--src/inhibitors/command/restrictedChannel.ts1
-rw-r--r--src/inhibitors/command/restrictedGuild.ts1
-rw-r--r--src/inhibitors/command/superUser.ts1
16 files changed, 16 insertions, 0 deletions
diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
index 019b778..5a0f0f1 100644
--- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
@@ -15,6 +15,7 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
if (client.isOwner(message.author) || /* client.isSuperUser(message.author) ||*/ client.user!.id === message.author.id)
return false;
if (client.cache.global.blacklistedChannels.includes(message.channel!.id) && !command.bypassChannelBlacklist) {
+ void client.console.verbose('channelGlobalBlacklist', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts
index 60bf452..a2c50e3 100644
--- a/src/inhibitors/blacklist/channelGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts
@@ -24,6 +24,7 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor {
(await message.guild.getSetting('blacklistedChannels'))?.includes(message.channel!.id) &&
!command.bypassChannelBlacklist
) {
+ void client.console.verbose('channelGuildBlacklist', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/blacklist/guildBlacklist.ts b/src/inhibitors/blacklist/guildBlacklist.ts
index be7ac22..4fb7b5a 100644
--- a/src/inhibitors/blacklist/guildBlacklist.ts
+++ b/src/inhibitors/blacklist/guildBlacklist.ts
@@ -18,6 +18,7 @@ export default class GuildBlacklistInhibitor extends BushInhibitor {
)
return false;
if (client.cache.global.blacklistedGuilds.includes(message.guild.id)) {
+ void client.console.verbose('guildBlacklist', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts
index 36d4b44..5d07ddb 100644
--- a/src/inhibitors/blacklist/userGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts
@@ -15,6 +15,7 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
return false;
if (client.cache.global.blacklistedUsers.includes(message.author.id)) {
+ void client.console.verbose('userGlobalBlacklist', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.inGuild() ? message.guild?.name : message.author.tag}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts
index dc299c3..e1c40ce 100644
--- a/src/inhibitors/blacklist/userGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/userGuildBlacklist.ts
@@ -15,6 +15,7 @@ export default class UserGuildBlacklistInhibitor extends BushInhibitor {
if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
return false;
if ((await message.guild.getSetting('blacklistedUsers'))?.includes(message.author.id)) {
+ void client.console.verbose('userGuildBlacklist', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/checks/fatal.ts b/src/inhibitors/checks/fatal.ts
index 1913fb6..68e1371 100644
--- a/src/inhibitors/checks/fatal.ts
+++ b/src/inhibitors/checks/fatal.ts
@@ -14,6 +14,7 @@ export default class FatalInhibitor extends BushInhibitor {
if (client.isOwner(message.author)) return false;
for (const property in client.cache.global) {
if (!client.cache.global[property as keyof typeof client.cache.global]) {
+ void client.console.verbose('fatal', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild?.name}>>.`)
return true;
}
}
diff --git a/src/inhibitors/checks/guildUnavailable.ts b/src/inhibitors/checks/guildUnavailable.ts
index 2ac491d..38d0ffa 100644
--- a/src/inhibitors/checks/guildUnavailable.ts
+++ b/src/inhibitors/checks/guildUnavailable.ts
@@ -12,6 +12,7 @@ export default class GuildUnavailableInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
if (message.guild && !message.guild.available) {
+ void client.console.verbose('guildUnavailable', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/command/dm.ts b/src/inhibitors/command/dm.ts
index c52425e..34fcb12 100644
--- a/src/inhibitors/command/dm.ts
+++ b/src/inhibitors/command/dm.ts
@@ -12,6 +12,7 @@ export default class DMInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (command.channel === 'dm' && message.guild) {
+ void client.console.verbose('dm', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/command/globalDisabledCommand.ts b/src/inhibitors/command/globalDisabledCommand.ts
index 80c1735..da267ef 100644
--- a/src/inhibitors/command/globalDisabledCommand.ts
+++ b/src/inhibitors/command/globalDisabledCommand.ts
@@ -13,6 +13,7 @@ export default class DisabledGuildCommandInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (message.author.isOwner()) return false;
if (client.cache.global.disabledCommands?.includes(command?.id)) {
+ void client.console.verbose('disabledGlobalCommand', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild?.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/command/guild.ts b/src/inhibitors/command/guild.ts
index d5f4f17..9843972 100644
--- a/src/inhibitors/command/guild.ts
+++ b/src/inhibitors/command/guild.ts
@@ -12,6 +12,7 @@ export default class GuildInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (command.channel === 'guild' && !message.guild) {
+ void client.console.verbose('guild', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.author.tag}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/command/guildDisabledCommand.ts b/src/inhibitors/command/guildDisabledCommand.ts
index 6b69e41..4343b1a 100644
--- a/src/inhibitors/command/guildDisabledCommand.ts
+++ b/src/inhibitors/command/guildDisabledCommand.ts
@@ -15,6 +15,7 @@ export default class DisabledGuildCommandInhibitor extends BushInhibitor {
if (message.author.isOwner() || message.author.isSuperUser()) return false; // super users bypass guild disabled commands
if ((await message.guild.getSetting('disabledCommands'))?.includes(command?.id)) {
+ void client.console.verbose('disabledGuildCommand', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/command/nsfw.ts b/src/inhibitors/command/nsfw.ts
index 3944fe3..7f0f3e7 100644
--- a/src/inhibitors/command/nsfw.ts
+++ b/src/inhibitors/command/nsfw.ts
@@ -13,6 +13,7 @@ export default class NsfwInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (command.onlyNsfw && !(message.channel as TextChannel).nsfw) {
+ void client.console.verbose('notNsfw', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild?.name}>>.`)
return true;
}
return false;
diff --git a/src/inhibitors/command/owner.ts b/src/inhibitors/command/owner.ts
index 816db0b..86bab76 100644
--- a/src/inhibitors/command/owner.ts
+++ b/src/inhibitors/command/owner.ts
@@ -13,6 +13,7 @@ export default class OwnerInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (command.ownerOnly) {
if (!client.isOwner(message.author)) {
+ void client.console.verbose('owner', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild?.name}>>.`)
return true;
}
}
diff --git a/src/inhibitors/command/restrictedChannel.ts b/src/inhibitors/command/restrictedChannel.ts
index 0f5efce..265200e 100644
--- a/src/inhibitors/command/restrictedChannel.ts
+++ b/src/inhibitors/command/restrictedChannel.ts
@@ -13,6 +13,7 @@ export default class RestrictedChannelInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (command.restrictedChannels?.length && message.channel) {
if (!command.restrictedChannels.includes(message.channel.id)) {
+ void client.console.verbose('restrictedChannel', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild?.name}>>.`)
return true;
}
}
diff --git a/src/inhibitors/command/restrictedGuild.ts b/src/inhibitors/command/restrictedGuild.ts
index 7b5dc58..a27220c 100644
--- a/src/inhibitors/command/restrictedGuild.ts
+++ b/src/inhibitors/command/restrictedGuild.ts
@@ -13,6 +13,7 @@ export default class RestrictedGuildInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (command.restrictedChannels?.length && message.channel) {
if (!command.restrictedChannels.includes(message.channel.id)) {
+ void client.console.verbose('restrictedGuild', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild?.name}>>.`)
return true;
}
}
diff --git a/src/inhibitors/command/superUser.ts b/src/inhibitors/command/superUser.ts
index 12f7246..a34df6d 100644
--- a/src/inhibitors/command/superUser.ts
+++ b/src/inhibitors/command/superUser.ts
@@ -13,6 +13,7 @@ export default class SuperUserInhibitor extends BushInhibitor {
public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
if (command.superUserOnly) {
if (!client.isSuperUser(message.author)) {
+ void client.console.verbose('superUser', `Blocked message with id <<${message.id}>> from <<${message.author.tag}>> in <<${message.guild?.name}>>.`)
return true;
}
}