aboutsummaryrefslogtreecommitdiff
path: root/src/inhibitors
diff options
context:
space:
mode:
Diffstat (limited to 'src/inhibitors')
-rw-r--r--src/inhibitors/blacklist/channelGlobalBlacklist.ts4
-rw-r--r--src/inhibitors/blacklist/channelGuildBlacklist.ts4
-rw-r--r--src/inhibitors/blacklist/guildBlacklist.ts4
-rw-r--r--src/inhibitors/blacklist/userGlobalBlacklist.ts4
-rw-r--r--src/inhibitors/blacklist/userGuildBlacklist.ts4
-rw-r--r--src/inhibitors/checks/fatal.ts5
-rw-r--r--src/inhibitors/checks/guildUnavailable.ts5
-rw-r--r--src/inhibitors/command/dm.ts4
-rw-r--r--src/inhibitors/command/globalDisabledCommand.ts4
-rw-r--r--src/inhibitors/command/guild.ts4
-rw-r--r--src/inhibitors/command/guildDisabledCommand.ts4
-rw-r--r--src/inhibitors/command/nsfw.ts4
-rw-r--r--src/inhibitors/command/owner.ts4
-rw-r--r--src/inhibitors/command/restrictedChannel.ts4
-rw-r--r--src/inhibitors/command/restrictedGuild.ts4
-rw-r--r--src/inhibitors/command/superUser.ts4
16 files changed, 34 insertions, 32 deletions
diff --git a/src/inhibitors/blacklist/channelGlobalBlacklist.ts b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
index 34c23af..1ac26f1 100644
--- a/src/inhibitors/blacklist/channelGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGlobalBlacklist.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
});
}
- public override exec(message: BushMessage | BushSlashMessage, command: BushCommand): boolean {
+ public override exec(message: CommandMessage | SlashMessage, command: BushCommand): boolean {
if (!message.author || !message.inGuild()) return false;
// do not change to message.author.isOwner()
if (client.isOwner(message.author) || client.user!.id === message.author.id) return false;
diff --git a/src/inhibitors/blacklist/channelGuildBlacklist.ts b/src/inhibitors/blacklist/channelGuildBlacklist.ts
index 09f58d0..a634015 100644
--- a/src/inhibitors/blacklist/channelGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/channelGuildBlacklist.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class ChannelGuildBlacklistInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class ChannelGuildBlacklistInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (!message.author || !message.inGuild()) return false;
// do not change to message.author.isOwner()
if (client.isOwner(message.author) || client.user!.id === message.author.id) return false;
diff --git a/src/inhibitors/blacklist/guildBlacklist.ts b/src/inhibitors/blacklist/guildBlacklist.ts
index d540af7..087bdb7 100644
--- a/src/inhibitors/blacklist/guildBlacklist.ts
+++ b/src/inhibitors/blacklist/guildBlacklist.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type CommandMessage, type SlashMessage } from '#lib';
export default class GuildBlacklistInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class GuildBlacklistInhibitor extends BushInhibitor {
});
}
- public override exec(message: BushMessage | BushSlashMessage): boolean {
+ public override exec(message: CommandMessage | SlashMessage): boolean {
if (!message.author || !message.inGuild()) return false;
// do not change to message.author.isOwner()
if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
diff --git a/src/inhibitors/blacklist/userGlobalBlacklist.ts b/src/inhibitors/blacklist/userGlobalBlacklist.ts
index a3b0cdc..ae488c8 100644
--- a/src/inhibitors/blacklist/userGlobalBlacklist.ts
+++ b/src/inhibitors/blacklist/userGlobalBlacklist.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type CommandMessage, type SlashMessage } from '#lib';
export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class UserGlobalBlacklistInhibitor extends BushInhibitor {
});
}
- public override exec(message: BushMessage | BushSlashMessage): boolean {
+ public override exec(message: CommandMessage | SlashMessage): boolean {
if (!message.author) return false;
// do not change to message.author.isOwner()
if (client.isOwner(message.author) || client.user!.id === message.author.id) return false;
diff --git a/src/inhibitors/blacklist/userGuildBlacklist.ts b/src/inhibitors/blacklist/userGuildBlacklist.ts
index b6c707a..c4fa527 100644
--- a/src/inhibitors/blacklist/userGuildBlacklist.ts
+++ b/src/inhibitors/blacklist/userGuildBlacklist.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type CommandMessage, type SlashMessage } from '#lib';
export default class UserGuildBlacklistInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class UserGuildBlacklistInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage): Promise<boolean> {
if (!message.author || !message.inGuild()) return false;
// do not change to message.author.isOwner()
if (client.isOwner(message.author) || client.isSuperUser(message.author) || client.user!.id === message.author.id)
diff --git a/src/inhibitors/checks/fatal.ts b/src/inhibitors/checks/fatal.ts
index 2521b2f..520754a 100644
--- a/src/inhibitors/checks/fatal.ts
+++ b/src/inhibitors/checks/fatal.ts
@@ -1,4 +1,5 @@
-import { BushInhibitor, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type SlashMessage } from '#lib';
+import { type Message } from 'discord.js';
export default class FatalInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +11,7 @@ export default class FatalInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
+ public override async exec(message: Message | SlashMessage): Promise<boolean> {
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]) {
diff --git a/src/inhibitors/checks/guildUnavailable.ts b/src/inhibitors/checks/guildUnavailable.ts
index a13944d..45ec0da 100644
--- a/src/inhibitors/checks/guildUnavailable.ts
+++ b/src/inhibitors/checks/guildUnavailable.ts
@@ -1,4 +1,5 @@
-import { BushInhibitor, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type SlashMessage } from '#lib';
+import { type Message } from 'discord.js';
export default class GuildUnavailableInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +11,7 @@ export default class GuildUnavailableInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage): Promise<boolean> {
+ public override async exec(message: Message | SlashMessage): Promise<boolean> {
if (message.inGuild() && !message.guild.available) {
void client.console.verbose(
'guildUnavailable',
diff --git a/src/inhibitors/command/dm.ts b/src/inhibitors/command/dm.ts
index ebcd647..d6c13a9 100644
--- a/src/inhibitors/command/dm.ts
+++ b/src/inhibitors/command/dm.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class DMInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class DMInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (command.channel === 'dm' && message.guild) {
void client.console.verbose(
'dm',
diff --git a/src/inhibitors/command/globalDisabledCommand.ts b/src/inhibitors/command/globalDisabledCommand.ts
index 0ec1305..ada9716 100644
--- a/src/inhibitors/command/globalDisabledCommand.ts
+++ b/src/inhibitors/command/globalDisabledCommand.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class DisabledGuildCommandInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class DisabledGuildCommandInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (message.author.isOwner()) return false;
if (client.cache.global.disabledCommands.includes(command?.id)) {
void client.console.verbose(
diff --git a/src/inhibitors/command/guild.ts b/src/inhibitors/command/guild.ts
index 69b5df9..8b249ff 100644
--- a/src/inhibitors/command/guild.ts
+++ b/src/inhibitors/command/guild.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class GuildInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class GuildInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (command.channel === 'guild' && !message.guild) {
void client.console.verbose(
'guild',
diff --git a/src/inhibitors/command/guildDisabledCommand.ts b/src/inhibitors/command/guildDisabledCommand.ts
index a04984d..a97f5cc 100644
--- a/src/inhibitors/command/guildDisabledCommand.ts
+++ b/src/inhibitors/command/guildDisabledCommand.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class DisabledGuildCommandInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class DisabledGuildCommandInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (!message.guild || !message.guild) return false;
if (message.author.isOwner() || message.author.isSuperUser()) return false; // super users bypass guild disabled commands
diff --git a/src/inhibitors/command/nsfw.ts b/src/inhibitors/command/nsfw.ts
index fb4e51f..6eb2878 100644
--- a/src/inhibitors/command/nsfw.ts
+++ b/src/inhibitors/command/nsfw.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
import { type TextChannel } from 'discord.js';
export default class NsfwInhibitor extends BushInhibitor {
@@ -11,7 +11,7 @@ export default class NsfwInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (command.onlyNsfw && !(message.channel as TextChannel).nsfw) {
void client.console.verbose(
'notNsfw',
diff --git a/src/inhibitors/command/owner.ts b/src/inhibitors/command/owner.ts
index 8eee1e0..2331e04 100644
--- a/src/inhibitors/command/owner.ts
+++ b/src/inhibitors/command/owner.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class OwnerInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class OwnerInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (command.ownerOnly) {
if (!client.isOwner(message.author)) {
void client.console.verbose(
diff --git a/src/inhibitors/command/restrictedChannel.ts b/src/inhibitors/command/restrictedChannel.ts
index c8f2e1e..6b06f95 100644
--- a/src/inhibitors/command/restrictedChannel.ts
+++ b/src/inhibitors/command/restrictedChannel.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class RestrictedChannelInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class RestrictedChannelInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (command.restrictedChannels?.length && message.channel) {
if (!command.restrictedChannels.includes(message.channel.id)) {
void client.console.verbose(
diff --git a/src/inhibitors/command/restrictedGuild.ts b/src/inhibitors/command/restrictedGuild.ts
index a8a5097..47c61ce 100644
--- a/src/inhibitors/command/restrictedGuild.ts
+++ b/src/inhibitors/command/restrictedGuild.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class RestrictedGuildInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class RestrictedGuildInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (command.restrictedChannels?.length && message.channel) {
if (!command.restrictedChannels.includes(message.channel.id)) {
void client.console.verbose(
diff --git a/src/inhibitors/command/superUser.ts b/src/inhibitors/command/superUser.ts
index a7c1f47..23b1c64 100644
--- a/src/inhibitors/command/superUser.ts
+++ b/src/inhibitors/command/superUser.ts
@@ -1,4 +1,4 @@
-import { BushInhibitor, type BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushInhibitor, type BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class SuperUserInhibitor extends BushInhibitor {
public constructor() {
@@ -10,7 +10,7 @@ export default class SuperUserInhibitor extends BushInhibitor {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, command: BushCommand): Promise<boolean> {
+ public override async exec(message: CommandMessage | SlashMessage, command: BushCommand): Promise<boolean> {
if (command.superUserOnly) {
if (!client.isSuperUser(message.author)) {
void client.console.verbose(