diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-09-07 21:33:37 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-09-07 21:33:37 -0400 |
commit | ed98ff7e2679f362f2657e77a6cf8dd3ce9b3d43 (patch) | |
tree | 75a6ba3cf992c1d563ddb8042d4cd9b4278207b8 /src/listeners | |
parent | 15b6988ccffc0a21a570bee7fcb8aabe6ffe08c7 (diff) | |
download | tanzanite-ed98ff7e2679f362f2657e77a6cf8dd3ce9b3d43.tar.gz tanzanite-ed98ff7e2679f362f2657e77a6cf8dd3ce9b3d43.tar.bz2 tanzanite-ed98ff7e2679f362f2657e77a6cf8dd3ce9b3d43.zip |
Diffstat (limited to 'src/listeners')
-rw-r--r-- | src/listeners/commands/commandBlocked.ts | 6 | ||||
-rw-r--r-- | src/listeners/commands/commandMissingPermissions.ts | 8 | ||||
-rw-r--r-- | src/listeners/interaction/interactionCreate.ts | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/listeners/commands/commandBlocked.ts b/src/listeners/commands/commandBlocked.ts index 534e744..c81857c 100644 --- a/src/listeners/commands/commandBlocked.ts +++ b/src/listeners/commands/commandBlocked.ts @@ -4,8 +4,8 @@ import { Emitter, emojis, format, + formatList, InhibitorReason, - oxford, type BotCommandHandlerEvents, type CommandMessage } from '#lib'; @@ -95,7 +95,7 @@ export default class CommandBlockedListener extends BotListener { channels!.forEach((c) => { names.push(`<#${c}>`); }); - const pretty = oxford(names, 'and'); + const pretty = formatList(names, 'and'); return await respond({ content: `${emojis.error} ${format.input(command!.id)} can only be run in ${pretty}.`, ephemeral: true @@ -105,7 +105,7 @@ export default class CommandBlockedListener extends BotListener { if (!command) break; const guilds = command.restrictedGuilds; const names = guilds!.map((g) => format.input(client.guilds.cache.get(g)?.name ?? g)); - const pretty = oxford(names, 'and'); + const pretty = formatList(names, 'and'); return await respond({ content: `${emojis.error} ${format.input(command!.id)} can only be run in ${pretty}.`, ephemeral: true diff --git a/src/listeners/commands/commandMissingPermissions.ts b/src/listeners/commands/commandMissingPermissions.ts index 9a59077..598b7d9 100644 --- a/src/listeners/commands/commandMissingPermissions.ts +++ b/src/listeners/commands/commandMissingPermissions.ts @@ -4,9 +4,9 @@ import { Emitter, emojis, format, + formatList, mappings, - oxford, - surroundArray, + surroundEach, type BotCommandHandlerEvents } from '#lib'; import { Client, type PermissionsString } from 'discord.js'; @@ -32,8 +32,8 @@ export default class CommandMissingPermissionsListener extends BotListener { (perm) => mappings.permissions[perm as PermissionsString]?.name ?? missing ); - const discordFormat = oxford(surroundArray(niceMissing, '**'), 'and', ''); - const consoleFormat = oxford(surroundArray(niceMissing, '<<', '>>'), 'and', ''); + const discordFormat = formatList(surroundEach(niceMissing, '**'), 'and'); + const consoleFormat = formatList(surroundEach(niceMissing, '<<', '>>'), 'and'); void client.console.info( 'commandMissingPermissions', `<<${message.author.tag}>> tried to run <<${ diff --git a/src/listeners/interaction/interactionCreate.ts b/src/listeners/interaction/interactionCreate.ts index c4c14c1..ced359c 100644 --- a/src/listeners/interaction/interactionCreate.ts +++ b/src/listeners/interaction/interactionCreate.ts @@ -3,9 +3,9 @@ import { Emitter, emojis, format, + formatList, handleAutomodInteraction, - oxford, - surroundArray, + surroundEach, type BotClientEvents } from '#lib'; import { Events, InteractionType } from 'discord.js'; @@ -68,7 +68,7 @@ export default class InteractionCreateListener extends BotListener { return await interaction.reply({ content: `You selected ${ Array.isArray(interaction.values) - ? oxford(surroundArray(interaction.values, '`'), 'and', '') + ? formatList(surroundEach(interaction.values, '`'), 'and') : format.input(interaction.values) }.`, ephemeral: true |