feat: eligible command

This commit is contained in:
TresAbhi committed 2023-06-04 00:01:10 +00:00
1 parent 1d0b428921
commit 804fa58d27
13 files changed
+219 -23

No files matched your search

+3 -3
View File
@@ -1,6 +1,6 @@
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
import { BlitzServer } from '../../constants/servers.js';
import errorEmbed from '../interaction/errorEmbed.js';
import negativeEmbed from '../interaction/negativeEmbed.js';
import listAccountsPanServer, {
usernamePatternWithoutPosition,
} from './listAccountsPanServer.js';
@@ -19,7 +19,7 @@ export default async function getBlitzAccount(
if (username === undefined) {
await interaction.editReply({
embeds: [
errorEmbed(
negativeEmbed(
'Username could not be inferred',
"You didn't provide me a username in the command nor was I able to infer your Blitz username from your Discord nickname. Try providing a username manually in the command or using the `/verify` command to set your Discord nickname to your Blitz username.",
),
@@ -42,7 +42,7 @@ export default async function getBlitzAccount(
} else {
await interaction.editReply({
embeds: [
errorEmbed(
negativeEmbed(
'Could not find user',
`I couldn't find user \`${username}\`. Try providing a username manually or using the \`/verify\` command to set your Discord nickname to your Blitz username.`,
),
+2 -2
View File
@@ -1,6 +1,6 @@
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
import { BlitzServer } from '../../constants/servers.js';
import errorEmbed from '../interaction/errorEmbed.js';
import negativeEmbed from '../interaction/negativeEmbed.js';
import { serverAndIdPattern } from './getBlitzAccount.js';
import listClansPanServer from './listClansPanServer.js';
@@ -19,7 +19,7 @@ export default async function getBlitzClan(
} else {
await interaction.editReply({
embeds: [
errorEmbed(
negativeEmbed(
'Could not find clan',
`I couldn't find clan \`${clan}\`. Try selecting a username from the search result.`,
),
+2 -2
View File
@@ -1,7 +1,7 @@
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers.js';
import { TanksStats } from '../../types/tanksStats.js';
import errorEmbed from '../interaction/errorEmbed.js';
import negativeEmbed from '../interaction/negativeEmbed.js';
import { args } from '../process/args.js';
import getWargamingResponse from './getWargamingResponse.js';
@@ -17,7 +17,7 @@ export default async function getTankStats(
if (tankStats[id] === null) {
interaction.editReply({
embeds: [
errorEmbed(
negativeEmbed(
'No tank stats available',
`Wargaming says there is no tank stats for this account. This account may not have any battles/tanks or exist in the ${BLITZ_SERVERS[server]} server.`,
),
+1 -1
View File
@@ -1,6 +1,6 @@
import { Percentile } from '../../constants/percentiles.js';
const WN8_PERCENTILES: [number, Percentile][] = [
export const WN8_PERCENTILES: [number, Percentile][] = [
[0, Percentile.VeryBad],
[300, Percentile.Bad],
[450, Percentile.BelowAverage],
+3 -3
View File
@@ -1,6 +1,6 @@
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
import { go } from 'fuzzysort';
import errorEmbed from '../interaction/errorEmbed.js';
import negativeEmbed from '../interaction/negativeEmbed.js';
import { TANKS, tankopedia } from './tankopedia.js';
export default async function resolveTankId(
@@ -15,7 +15,7 @@ export default async function resolveTankId(
if (searchResult.length === 0) {
await interaction.editReply({
embeds: [
errorEmbed(
negativeEmbed(
'Tank not found',
`Could not find tank by the name "${tank}".`,
),
@@ -32,7 +32,7 @@ export default async function resolveTankId(
} else {
await interaction.editReply({
embeds: [
errorEmbed(
negativeEmbed(
'Tank not found',
`Could not find tank by the ID "${number}".`,
),