diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-11-07 09:25:13 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-11-07 09:25:13 -0500 |
commit | a39aa8c11a3fd5dd5f007865960ef5429744f057 (patch) | |
tree | ee5b25025f07cd5ae2718ab251f1471847eb5cb8 /src | |
parent | c501d4c45e19b47f6fb358253c7ff3a1413da222 (diff) | |
download | tanzanite-a39aa8c11a3fd5dd5f007865960ef5429744f057.tar.gz tanzanite-a39aa8c11a3fd5dd5f007865960ef5429744f057.tar.bz2 tanzanite-a39aa8c11a3fd5dd5f007865960ef5429744f057.zip |
made some constants enums and fixed perm check overriding inhibitors
Diffstat (limited to 'src')
-rw-r--r-- | src/inhibitors/blacklist/channelGlobalBlacklist.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/blacklist/channelGuildBlacklist.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/blacklist/guildBlacklist.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/blacklist/userGlobalBlacklist.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/blacklist/userGuildBlacklist.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/checks/fatal.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/checks/guildUnavailable.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/dm.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/globalDisabledCommand.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/guild.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/guildDisabledCommand.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/nsfw.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/owner.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/restrictedChannel.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/restrictedGuild.ts | 1 | ||||
-rw-r--r-- | src/inhibitors/command/superUser.ts | 1 | ||||
-rw-r--r-- | src/lib/extensions/discord-akairo/BushClient.ts | 4 | ||||
-rw-r--r-- | src/lib/extensions/discord-akairo/BushCommand.ts | 56 | ||||
-rw-r--r-- | src/lib/utils/BushConstants.ts | 358 |
19 files changed, 200 insertions, 234 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; } } diff --git a/src/lib/extensions/discord-akairo/BushClient.ts b/src/lib/extensions/discord-akairo/BushClient.ts index 6b25aaa..0fb84f3 100644 --- a/src/lib/extensions/discord-akairo/BushClient.ts +++ b/src/lib/extensions/discord-akairo/BushClient.ts @@ -224,7 +224,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re makeCache: Options.cacheWithLimits({}) }); - this.token = config.token; + this.token = config.token as If<Ready, string, string | null>; this.config = config; // Create listener handler this.listenerHandler = new BushListenerHandler(this, { @@ -274,7 +274,7 @@ export class BushClient<Ready extends boolean = boolean> extends AkairoClient<Re }, automateCategories: false, autoRegisterSlashCommands: true, - skipBuiltInPostInhibitors: false, + skipBuiltInPostInhibitors: true, useSlashPermissions: true, aliasReplacement: /-/g }); diff --git a/src/lib/extensions/discord-akairo/BushCommand.ts b/src/lib/extensions/discord-akairo/BushCommand.ts index b079649..03f6606 100644 --- a/src/lib/extensions/discord-akairo/BushCommand.ts +++ b/src/lib/extensions/discord-akairo/BushCommand.ts @@ -1,60 +1,10 @@ import { type BushClient, type BushCommandHandler, type BushMessage, type BushSlashMessage } from '#lib'; import { Command, type ArgumentOptions, type ArgumentPromptOptions, type ArgumentTypeCaster, type CommandOptions } from 'discord-akairo'; +import { BaseArgumentType } from 'discord-akairo/dist/src/struct/commands/arguments/Argument'; import { type PermissionResolvable, type Snowflake } from 'discord.js'; -export type BaseBushArgumentType = - | 'string' - | 'lowercase' - | 'uppercase' - | 'charCodes' - | 'number' - | 'integer' - | 'bigint' - | 'emojint' - | 'url' - | 'date' - | 'color' - | 'user' - | 'users' - | 'member' - | 'members' - | 'relevant' - | 'relevants' - | 'channel' - | 'channels' - | 'textChannel' - | 'textChannels' - | 'voiceChannel' - | 'voiceChannels' - | 'categoryChannel' - | 'categoryChannels' - | 'newsChannel' - | 'newsChannels' - | 'storeChannel' - | 'storeChannels' - | 'stageChannel' - | 'stageChannels' - | 'threadChannel' - | 'threadChannels' - | 'role' - | 'roles' - | 'emoji' - | 'emojis' - | 'guild' - | 'guilds' - | 'message' - | 'guildMessage' - | 'relevantMessage' - | 'invite' - | 'userMention' - | 'memberMention' - | 'channelMention' - | 'roleMention' - | 'emojiMention' - | 'commandAlias' - | 'command' - | 'inhibitor' - | 'listener' +export type BaseBushArgumentType = + | BaseArgumentType | 'duration' | 'contentWithDuration' | 'permission' diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index 0377026..c719f72 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -2,23 +2,8 @@ import { Constants, type ConstantsColors } from 'discord.js'; const rawCapeUrl = 'https://raw.githubusercontent.com/NotEnoughUpdates/capes/master/'; export class BushConstants { - public static emojis = { - success: '<:success:837109864101707807>', - warn: '<:warn:848726900876247050>', - error: '<:error:837123021016924261>', - successFull: '<:success_full:850118767576088646>', - warnFull: '<:warn_full:850118767391539312>', - errorFull: '<:error_full:850118767295201350>', - mad: '<:mad:783046135392239626>', - join: '<:join:850198029809614858>', - leave: '<:leave:850198048205307919>', - loading: '<a:Loading:853419254619963392>', - offlineCircle: '<:offline:787550565382750239>', - dndCircle: '<:dnd:787550487633330176>', - idleCircle: '<:idle:787550520956551218>', - onlineCircle: '<:online:787550449435803658>', - cross: '<:cross:878319362539421777>', - check: '<:check:878320135297961995>' + public static get emojis() { + return BushEmojis }; public static colors: bushColors = { @@ -88,28 +73,8 @@ export class BushConstants { discordEmoji: /<a?:(?<name>[a-zA-Z0-9_]+):(?<id>\d{15,21})>/im }; - public static pronounMapping: { [x in PronounCode]: Pronoun } = { - unspecified: 'Unspecified', - hh: 'He/Him', - hi: 'He/It', - hs: 'He/She', - ht: 'He/They', - ih: 'It/Him', - ii: 'It/Its', - is: 'It/She', - it: 'It/They', - shh: 'She/He', - sh: 'She/Her', - si: 'She/It', - st: 'She/They', - th: 'They/He', - ti: 'They/It', - ts: 'They/She', - tt: 'They/Them', - any: 'Any pronouns', - other: 'Other pronouns', - ask: 'Ask me my pronouns', - avoid: 'Avoid pronouns, use my name' + public static get pronounMapping() { + return PronounMap }; /** A bunch of mappings */ @@ -257,7 +222,8 @@ export class BushConstants { BUGHUNTER_LEVEL_2: '<:bugHunterGold:848743283080822794>', VERIFIED_BOT: 'VERIFIED_BOT', EARLY_VERIFIED_BOT_DEVELOPER: '<:earlyVerifiedBotDeveloper:848741079875846174>', - DISCORD_CERTIFIED_MODERATOR: '<:discordCertifiedModerator:877224285901582366>' + DISCORD_CERTIFIED_MODERATOR: '<:discordCertifiedModerator:877224285901582366>', + BOT_HTTP_INTERACTIONS: 'BOT_HTTP_INTERACTIONS' }, status: { @@ -362,107 +328,20 @@ export class BushConstants { } }; - public static ArgumentMatches = { - PHRASE: 'phrase', - FLAG: 'flag', - OPTION: 'option', - REST: 'rest', - SEPARATE: 'separate', - TEXT: 'text', - CONTENT: 'content', - REST_CONTENT: 'restContent', - NONE: 'none' + public static get ArgumentMatches() { + return ArgumentMatches }; - public static ArgumentTypes = { - STRING: 'string', - LOWERCASE: 'lowercase', - UPPERCASE: 'uppercase', - CHAR_CODES: 'charCodes', - NUMBER: 'number', - INTEGER: 'integer', - BIGINT: 'bigint', - EMOJINT: 'emojint', - URL: 'url', - DATE: 'date', - COLOR: 'color', - USER: 'user', - USERS: 'users', - MEMBER: 'member', - MEMBERS: 'members', - RELEVANT: 'relevant', - RELEVANTS: 'relevants', - CHANNEL: 'channel', - CHANNELS: 'channels', - TEXT_CHANNEL: 'textChannel', - TEXT_CHANNELS: 'textChannels', - VOICE_CHANNEL: 'voiceChannel', - VOICE_CHANNELS: 'voiceChannels', - CATEGORY_CHANNEL: 'categoryChannel', - CATEGORY_CHANNELS: 'categoryChannels', - NEWS_CHANNEL: 'newsChannel', - NEWS_CHANNELS: 'newsChannels', - STORE_CHANNEL: 'storeChannel', - STORE_CHANNELS: 'storeChannels', - ROLE: 'role', - ROLES: 'roles', - EMOJI: 'emoji', - EMOJIS: 'emojis', - GUILD: 'guild', - GUILDS: 'guilds', - MESSAGE: 'message', - GUILD_MESSAGE: 'guildMessage', - RELEVANT_MESSAGE: 'relevantMessage', - INVITE: 'invite', - MEMBER_MENTION: 'memberMention', - CHANNEL_MENTION: 'channelMention', - ROLE_MENTION: 'roleMention', - EMOJI_MENTION: 'emojiMention', - COMMAND_ALIAS: 'commandAlias', - COMMAND: 'command', - INHIBITOR: 'inhibitor', - LISTENER: 'listener' + public static get ArgumentTypes() { + return BushArgumentTypes }; - public static BlockedReasons = { - CLIENT: 'client', - BOT: 'bot', - OWNER: 'owner', - SUPER_USER: 'superUser', - GUILD: 'guild', - DM: 'dm', - AUTHOR_NOT_FOUND: 'authorNotFound', - DISABLED_GUILD: 'disabledGuild', - DISABLED_GLOBAL: 'disabledGlobal', - ROLE_BLACKLIST: 'roleBlacklist', - USER_GUILD_BLACKLIST: 'userGuildBlacklist', - USER_GLOBAL_BLACKLIST: 'userGlobalBlacklist', - RESTRICTED_GUILD: 'restrictedGuild', - CHANNEL_GUILD_BLACKLIST: 'channelGuildBlacklist', - CHANNEL_GLOBAL_BLACKLIST: 'channelGlobalBlacklist', - RESTRICTED_CHANNEL: 'restrictedChannel' + public static get BlockedReasons() { + return BushBlockedReasons }; - public static CommandHandlerEvents = { - MESSAGE_BLOCKED: 'messageBlocked', - MESSAGE_INVALID: 'messageInvalid', - COMMAND_BLOCKED: 'commandBlocked', - COMMAND_STARTED: 'commandStarted', - COMMAND_FINISHED: 'commandFinished', - COMMAND_CANCELLED: 'commandCancelled', - COMMAND_LOCKED: 'commandLocked', - COMMAND_INVALID: 'commandInvalid', - COMMAND_LOCKED_NSFW: 'commandLockedNsfw', - MISSING_PERMISSIONS: 'missingPermissions', - COOLDOWN: 'cooldown', - IN_PROMPT: 'inPrompt', - ERROR: 'error', - SLASH_ERROR: 'slashError', - SLASH_BLOCKED: 'slashCommandBlocked', - SLASH_STARTED: 'slashStarted', - SLASH_FINISHED: 'slashFinished', - SLASH_NOT_FOUND: 'slashNotFound', - SLASH_MISSING_PERMISSIONS: 'slashMissingPermissions' + public static get CommandHandlerEvents() { + return BushCommandHandlerEvents }; public static moulberryBushRoleMap = [ @@ -494,6 +373,169 @@ export class BushConstants { ]; } +export enum PronounMap { + unspecified = 'Unspecified', + hh = 'He/Him', + hi = 'He/It', + hs = 'He/She', + ht = 'He/They', + ih = 'It/Him', + ii = 'It/Its', + is = 'It/She', + it = 'It/They', + shh = 'She/He', + sh = 'She/Her', + si = 'She/It', + st = 'She/They', + th = 'They/He', + ti = 'They/It', + ts = 'They/She', + tt = 'They/Them', + any = 'Any pronouns', + other = 'Other pronouns', + ask = 'Ask me my pronouns', + avoid = 'Avoid pronouns, use my name' +} + +export enum BushEmojis { + success = '<:success:837109864101707807>', + warn = '<:warn:848726900876247050>', + error = '<:error:837123021016924261>', + successFull = '<:success_full:850118767576088646>', + warnFull = '<:warn_full:850118767391539312>', + errorFull = '<:error_full:850118767295201350>', + mad = '<:mad:783046135392239626>', + join = '<:join:850198029809614858>', + leave = '<:leave:850198048205307919>', + loading = '<a:Loading:853419254619963392>', + offlineCircle = '<:offline:787550565382750239>', + dndCircle = '<:dnd:787550487633330176>', + idleCircle = '<:idle:787550520956551218>', + onlineCircle = '<:online:787550449435803658>', + cross = '<:cross:878319362539421777>', + check = '<:check:878320135297961995>' +} + +export enum ArgumentMatches { + PHRASE = "phrase", + FLAG = "flag", + OPTION = "option", + REST = "rest", + SEPARATE = "separate", + TEXT = "text", + CONTENT = "content", + REST_CONTENT = "restContent", + NONE = "none" +} + +export enum BushArgumentTypes { + STRING = "string", + LOWERCASE = "lowercase", + UPPERCASE = "uppercase", + CHAR_CODES = "charCodes", + NUMBER = "number", + INTEGER = "integer", + BIGINT = "bigint", + EMOJINT = "emojint", + URL = "url", + DATE = "date", + COLOR = "color", + USER = "user", + USERS = "users", + MEMBER = "member", + MEMBERS = "members", + RELEVANT = "relevant", + RELEVANTS = "relevants", + CHANNEL = "channel", + CHANNELS = "channels", + TEXT_CHANNEL = "textChannel", + TEXT_CHANNELS = "textChannels", + VOICE_CHANNEL = "voiceChannel", + VOICE_CHANNELS = "voiceChannels", + CATEGORY_CHANNEL = "categoryChannel", + CATEGORY_CHANNELS = "categoryChannels", + NEWS_CHANNEL = "newsChannel", + NEWS_CHANNELS = "newsChannels", + STORE_CHANNEL = "storeChannel", + STORE_CHANNELS = "storeChannels", + STAGE_CHANNEL = "stageChannel", + STAGE_CHANNELS = "stageChannels", + THREAD_CHANNEL = "threadChannel", + THREAD_CHANNELS = "threadChannels", + ROLE = "role", + ROLES = "roles", + EMOJI = "emoji", + EMOJIS = "emojis", + GUILD = "guild", + GUILDS = "guilds", + MESSAGE = "message", + GUILD_MESSAGE = "guildMessage", + RELEVANT_MESSAGE = "relevantMessage", + INVITE = "invite", + USER_MENTION = "userMention", + MEMBER_MENTION = "memberMention", + CHANNEL_MENTION = "channelMention", + ROLE_MENTION = "roleMention", + EMOJI_MENTION = "emojiMention", + COMMAND_ALIAS = "commandAlias", + COMMAND = "command", + INHIBITOR = "inhibitor", + LISTENER = "listener", + TASK = "task", + CONTEXT_MENU_COMMAND = "contextMenuCommand", + DURATION = 'duration', + CONTENT_WITH_DURATION = 'contentWithDuration', + PERMISSION = 'permission', + SNOWFLAKE = 'snowflake', + DISCORD_EMOJI = 'discordEmoji', + ROLE_WITH_DURATION = 'roleWithDuration', + ABBREVIATED_NUMBER = 'abbreviatedNumber', + GLOBAL_USER = 'globalUser', +} + +export enum BushBlockedReasons { + CLIENT = 'client', + BOT = 'bot', + OWNER = 'owner', + SUPER_USER = 'superUser', + GUILD = 'guild', + DM = 'dm', + AUTHOR_NOT_FOUND = 'authorNotFound', + NOT_NSFW = "notNsfw", + DISABLED_GUILD = 'disabledGuild', + DISABLED_GLOBAL = 'disabledGlobal', + ROLE_BLACKLIST = 'roleBlacklist', + USER_GUILD_BLACKLIST = 'userGuildBlacklist', + USER_GLOBAL_BLACKLIST = 'userGlobalBlacklist', + RESTRICTED_GUILD = 'restrictedGuild', + CHANNEL_GUILD_BLACKLIST = 'channelGuildBlacklist', + CHANNEL_GLOBAL_BLACKLIST = 'channelGlobalBlacklist', + RESTRICTED_CHANNEL = 'restrictedChannel' +} + +export enum BushCommandHandlerEvents { + COMMAND_BLOCKED = "commandBlocked", + COMMAND_BREAKOUT = "commandBreakout", + COMMAND_CANCELLED = "commandCancelled", + COMMAND_FINISHED = "commandFinished", + COMMAND_INVALID = "commandInvalid", + COMMAND_LOCKED = "commandLocked", + COMMAND_STARTED = "commandStarted", + COOLDOWN = "cooldown", + ERROR = "error", + IN_PROMPT = "inPrompt", + MESSAGE_BLOCKED = "messageBlocked", + MESSAGE_INVALID = "messageInvalid", + MISSING_PERMISSIONS = "missingPermissions", + SLASH_BLOCKED = "slashBlocked", + SLASH_ERROR = "slashError", + SLASH_FINISHED = "slashFinished", + SLASH_MISSING_PERMISSIONS = "slashMissingPermissions", + SLASH_NOT_FOUND = "slashNotFound", + SLASH_STARTED = "slashStarted", + SLASH_ONLY = "slashOnly" +} + interface bushColors { default: '#1FD8F1'; error: '#EF4947'; @@ -520,47 +562,5 @@ interface bushColors { discord: ConstantsColors; } -export type PronounCode = - | 'unspecified' - | 'hh' - | 'hi' - | 'hs' - | 'ht' - | 'ih' - | 'ii' - | 'is' - | 'it' - | 'shh' - | 'sh' - | 'si' - | 'st' - | 'th' - | 'ti' - | 'ts' - | 'tt' - | 'any' - | 'other' - | 'ask' - | 'avoid'; -export type Pronoun = - | 'Unspecified' - | 'He/Him' - | 'He/It' - | 'He/She' - | 'He/They' - | 'It/Him' - | 'It/Its' - | 'It/She' - | 'It/They' - | 'She/He' - | 'She/Her' - | 'She/It' - | 'She/They' - | 'They/He' - | 'They/It' - | 'They/She' - | 'They/Them' - | 'Any pronouns' - | 'Other pronouns' - | 'Ask me my pronouns' - | 'Avoid pronouns, use my name'; +export type PronounCode = keyof typeof PronounMap +export type Pronoun = PronounMap
\ No newline at end of file |