mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
feat: eligible command
This commit is contained in:
1 parent
1d0b428921
commit
804fa58d27
13 files changed
+219
-23
No files matched your search
@@ -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.`,
|
||||
),
|
||||
|
||||
@@ -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.`,
|
||||
),
|
||||
|
||||
@@ -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,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],
|
||||
|
||||
@@ -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}".`,
|
||||
),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import { NEGATIVE_COLOR } from '../../constants/colors.js';
|
||||
|
||||
export default function errorEmbed(title: string, description: string) {
|
||||
export default function negativeEmbed(title: string, description: string) {
|
||||
return new EmbedBuilder()
|
||||
.setColor(NEGATIVE_COLOR)
|
||||
.setTitle(title)
|
||||
@@ -1,6 +1,6 @@
|
||||
import errorEmbed from './errorEmbed.js';
|
||||
import negativeEmbed from './negativeEmbed.js';
|
||||
|
||||
export const noMember = errorEmbed(
|
||||
export const noMember = negativeEmbed(
|
||||
'User of command is not a member',
|
||||
'Discord claims that the user of this command does not have an account... strange!',
|
||||
);
|
||||
@@ -1,6 +1,6 @@
|
||||
import errorEmbed from './errorEmbed.js';
|
||||
import negativeEmbed from './negativeEmbed.js';
|
||||
|
||||
export const notTrackedByBlitzStars = errorEmbed(
|
||||
export const notTrackedByBlitzStars = negativeEmbed(
|
||||
'No data to display',
|
||||
'Player is not tracked by BlitzStars.',
|
||||
);
|
||||
@@ -0,0 +1,9 @@
|
||||
import { EmbedBuilder } from 'discord.js';
|
||||
import { POSITIVE_COLOR } from '../../constants/colors.js';
|
||||
|
||||
export default function positiveEmbed(title: string, description: string) {
|
||||
return new EmbedBuilder()
|
||||
.setColor(POSITIVE_COLOR)
|
||||
.setTitle(title)
|
||||
.setDescription(description);
|
||||
}
|
||||
Reference in new issue
Block a user