aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors/command
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-07 09:25:13 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-11-07 09:25:13 -0500
commita39aa8c11a3fd5dd5f007865960ef5429744f057 (patch)
treeee5b25025f07cd5ae2718ab251f1471847eb5cb8 /src/inhibitors/command
parentc501d4c45e19b47f6fb358253c7ff3a1413da222 (diff)
downloadtanzanite-a39aa8c11a3fd5dd5f007865960ef5429744f057.tar.gz
tanzanite-a39aa8c11a3fd5dd5f007865960ef5429744f057.tar.bz2
tanzanite-a39aa8c11a3fd5dd5f007865960ef5429744f057.zip
made some constants enums and fixed perm check overriding inhibitors
Diffstat (limited to 'src/inhibitors/command')
-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
9 files changed, 9 insertions, 0 deletions
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;
}
}