mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: rename to blitzkrieg
This commit is contained in:
1 parent
c61877a267
commit
bc798da88b
19 files changed
+47
-193
No files matched your search
Vendored
-1
@@ -5,7 +5,6 @@
|
|||||||
"kranvagn",
|
"kranvagn",
|
||||||
"ownedtanks",
|
"ownedtanks",
|
||||||
"searchplayers",
|
"searchplayers",
|
||||||
"SKLLD",
|
|
||||||
"Smri",
|
"Smri",
|
||||||
"strvk",
|
"strvk",
|
||||||
"tankopedia",
|
"tankopedia",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
# Skilled Bot
|
# blitzkrieg
|
||||||
|
|
||||||
Executes specific tasks in the Skilled Discord server.
|
A Discord bot for anything and everything related to World of Tanks Blitz.
|
||||||
|
|
||||||
## Invite the Bot
|
## Invite the Bot
|
||||||
|
|
||||||
Join the [Skilled Discord server](https://discord.gg/ZPvcEG7DS8), click on the bot's profile, and click "Add to Server".
|
Join the [Discord server](https://discord.gg/nDt7AjGJQH), click on the bot's profile, and click "Add to Server".
|
||||||
|
|
||||||
## Using
|
## Using
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "sklld-bot",
|
"name": "blitzkrieg",
|
||||||
"version": "0.6.0",
|
"version": "0.6.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||||
import packageJSON from '../../package.json' assert { type: 'json' };
|
import packageJSON from '../../package.json' assert { type: 'json' };
|
||||||
import { SKILLED_COLOR } from '../constants/colors.js';
|
import { INFO_COLOR } from '../constants/colors.js';
|
||||||
import { tankopedia } from '../core/blitzstars/tankopedia.js';
|
import { tankopedia } from '../core/blitzstars/tankopedia.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
import getClientId from '../core/process/getClientId.js';
|
import getClientId from '../core/process/getClientId.js';
|
||||||
import { client } from '../index.js';
|
|
||||||
import { CommandRegistry } from '../events/interactionCreate.js';
|
import { CommandRegistry } from '../events/interactionCreate.js';
|
||||||
|
import { client } from '../index.js';
|
||||||
|
|
||||||
const executionStart = new Date().getTime();
|
const executionStart = new Date().getTime();
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ export default {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle(`${client.user?.username} debug information`)
|
.setTitle(`${client.user?.username} debug information`)
|
||||||
.setColor(SKILLED_COLOR)
|
.setColor(INFO_COLOR)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**Version**: ${packageJSON.version}\n**Uptime**: ${Math.floor(
|
`**Version**: ${packageJSON.version}\n**Uptime**: ${Math.floor(
|
||||||
uptime / 1000 / 60 / 60 / 24,
|
uptime / 1000 / 60 / 60 / 24,
|
||||||
|
|||||||
@@ -1,149 +0,0 @@
|
|||||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
|
||||||
import markdownEscape from 'markdown-escape';
|
|
||||||
import { NEGATIVE_COLOR, POSITIVE_COLOR } from '../constants/colors.js';
|
|
||||||
import { BlitzServer } from '../constants/servers.js';
|
|
||||||
import usernameAutocomplete from '../core/autocomplete/username.js';
|
|
||||||
import getBlitzAccount from '../core/blitz/getBlitzAccount.js';
|
|
||||||
import blitzStarsLinks from '../core/blitzstars/blitzStarsLinks.js';
|
|
||||||
import getBlitzStarsAccount from '../core/blitzstars/getBlitzStarsAccount.js';
|
|
||||||
import poweredByBlitzStars from '../core/blitzstars/poweredByBlitzStars.js';
|
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
|
||||||
import addServerChoices from '../core/options/addServerChoices.js';
|
|
||||||
import addUsernameOption from '../core/options/addUsernameOption.js';
|
|
||||||
import { CommandRegistry } from '../events/interactionCreate.js';
|
|
||||||
|
|
||||||
const CLANS = {
|
|
||||||
sklld: { id: 71559, name: 'Skilled' },
|
|
||||||
smri: { id: 91244, name: 'Samurai' },
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
inProduction: false,
|
|
||||||
inDevelopment: false,
|
|
||||||
inPublic: false,
|
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
|
||||||
.setName(cmdName('eligible'))
|
|
||||||
.setDescription("Gets the user's eligibility for Skilled clans")
|
|
||||||
.addStringOption((option) =>
|
|
||||||
option
|
|
||||||
.setName('clan')
|
|
||||||
.setDescription('The Skilled clan you are checking')
|
|
||||||
.addChoices(
|
|
||||||
{ name: CLANS.sklld.name, value: 'sklld' },
|
|
||||||
{ name: CLANS.smri.name, value: 'smri' },
|
|
||||||
)
|
|
||||||
.setRequired(true),
|
|
||||||
)
|
|
||||||
.addStringOption(addServerChoices)
|
|
||||||
.addStringOption(addUsernameOption),
|
|
||||||
|
|
||||||
async execute(interaction) {
|
|
||||||
const clan = interaction.options.getString('clan') as keyof typeof CLANS;
|
|
||||||
const name = interaction.options.getString('username')!;
|
|
||||||
const server = interaction.options.getString('server') as BlitzServer;
|
|
||||||
const blitzAccount = await getBlitzAccount(interaction, name, server);
|
|
||||||
|
|
||||||
if (!blitzAccount) return;
|
|
||||||
|
|
||||||
const blitzStarsAccount = await getBlitzStarsAccount(
|
|
||||||
interaction,
|
|
||||||
blitzAccount.account_id,
|
|
||||||
);
|
|
||||||
if (!blitzStarsAccount) return;
|
|
||||||
|
|
||||||
const issues: string[] = [];
|
|
||||||
|
|
||||||
if (clan === 'sklld') {
|
|
||||||
if (blitzStarsAccount.period30d.all.battles < 150) {
|
|
||||||
issues.push(
|
|
||||||
`**Battles**: ${blitzStarsAccount.period30d.all.battles} (${
|
|
||||||
blitzStarsAccount.period30d.all.battles - 150
|
|
||||||
})`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (blitzStarsAccount.period30d.avg_tier < 8) {
|
|
||||||
issues.push(
|
|
||||||
`**Tier**: ${blitzStarsAccount.period30d.avg_tier.toFixed(2)} (${(
|
|
||||||
blitzStarsAccount.period30d.avg_tier - 8
|
|
||||||
).toFixed(2)})`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (blitzStarsAccount.period30d.special.winrate < 60) {
|
|
||||||
issues.push(
|
|
||||||
`**Winrate**: ${blitzStarsAccount.period30d.special.winrate.toFixed(
|
|
||||||
2,
|
|
||||||
)}% (${(blitzStarsAccount.period30d.special.winrate - 60).toFixed(
|
|
||||||
2,
|
|
||||||
)}%)`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (blitzStarsAccount.period30d.wn8 < 2100) {
|
|
||||||
issues.push(
|
|
||||||
`**WN8**: ${blitzStarsAccount.period30d.wn8.toFixed(0)} (${(
|
|
||||||
blitzStarsAccount.period30d.wn8 - 2100
|
|
||||||
).toFixed(0)})`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (blitzStarsAccount.period30d.special.dpb < 2400) {
|
|
||||||
issues.push(
|
|
||||||
`**Damage per battle**: ${blitzStarsAccount.period30d.special.dpb.toFixed(
|
|
||||||
0,
|
|
||||||
)} (${(blitzStarsAccount.period30d.special.dpb - 2400).toFixed(0)})`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (blitzStarsAccount.statistics.all.battles < 1500) {
|
|
||||||
issues.push(
|
|
||||||
`**Battles**: ${blitzStarsAccount.statistics.all.battles} (${
|
|
||||||
blitzStarsAccount.statistics.all.battles - 1500
|
|
||||||
})`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (blitzStarsAccount.statistics.special.winrate < 53) {
|
|
||||||
issues.push(
|
|
||||||
`**Winrate**: ${blitzStarsAccount.statistics.special.winrate.toFixed(
|
|
||||||
2,
|
|
||||||
)}% (${(blitzStarsAccount.statistics.special.winrate - 53).toFixed(
|
|
||||||
2,
|
|
||||||
)}%)`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const eligible = issues.length === 0;
|
|
||||||
|
|
||||||
await interaction.editReply({
|
|
||||||
embeds: [
|
|
||||||
poweredByBlitzStars(
|
|
||||||
new EmbedBuilder()
|
|
||||||
.setTitle(
|
|
||||||
`${markdownEscape(blitzStarsAccount.nickname)} is ${
|
|
||||||
eligible ? '' : 'not '
|
|
||||||
}eligible for ${CLANS[clan].name}`,
|
|
||||||
)
|
|
||||||
.setColor(eligible ? POSITIVE_COLOR : NEGATIVE_COLOR)
|
|
||||||
.setDescription(
|
|
||||||
`${
|
|
||||||
eligible
|
|
||||||
? `${markdownEscape(
|
|
||||||
blitzStarsAccount.nickname,
|
|
||||||
)} meets all the requirements set for ${CLANS[clan].name}.`
|
|
||||||
: `${markdownEscape(
|
|
||||||
blitzStarsAccount.nickname,
|
|
||||||
)}'s shortcomings for ${CLANS[clan].name} (${
|
|
||||||
clan === 'sklld' ? '30 days stats' : 'career stats'
|
|
||||||
}):\n\n${issues.join('\n')}`
|
|
||||||
}\n\n${blitzStarsLinks(server, blitzAccount.nickname)}`,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(
|
|
||||||
`Showing ${blitzStarsAccount.nickname}'s eligibility for ${CLANS[clan].name}`,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
autocomplete: usernameAutocomplete,
|
|
||||||
} satisfies CommandRegistry;
|
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||||
import discord from '../../discord.json' assert { type: 'json' };
|
import discord from '../../discord.json' assert { type: 'json' };
|
||||||
import { SKILLED_COLOR } from '../constants/colors.js';
|
import { INFO_COLOR } from '../constants/colors.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
|
import {
|
||||||
|
CommandRegistry,
|
||||||
|
guildCommands,
|
||||||
|
publicCommands,
|
||||||
|
} from '../events/interactionCreate.js';
|
||||||
import { client } from '../index.js';
|
import { client } from '../index.js';
|
||||||
import { CommandRegistry, guildCommands, publicCommands } from '../events/interactionCreate.js';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
@@ -19,11 +23,11 @@ export default {
|
|||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setTitle(`${client.user?.username} help`)
|
.setTitle(`${client.user?.username} help`)
|
||||||
.setColor(SKILLED_COLOR)
|
.setColor(INFO_COLOR)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**About**\n${
|
`**About**\n${
|
||||||
client.user?.username
|
client.user?.username
|
||||||
} automates many mundane tasks and provide statistics in numerous flexible ways.\n\nMade by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/tresabhi/sklld-bot\nDiscord server: https://discord.gg/nDt7AjGJQH\nSkilled server: https://discord.gg/ZPvcEG7DS8\n\n**Commands**\n${(interaction.guildId ===
|
} automates many mundane tasks and provide statistics in numerous flexible ways.\n\nMade by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/tresabhi/blitzkrieg\nDiscord server: https://discord.gg/nDt7AjGJQH\nSkilled server: https://discord.gg/ZPvcEG7DS8\n\n**Commands**\n${(interaction.guildId ===
|
||||||
discord.sklld_guild_id
|
discord.sklld_guild_id
|
||||||
? [...guildCommands, ...publicCommands]
|
? [...guildCommands, ...publicCommands]
|
||||||
: publicCommands
|
: publicCommands
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { SKILLED_COLOR } from '../constants/colors.js';
|
import { INFO_COLOR } from '../constants/colors.js';
|
||||||
import usernameAutocomplete from '../core/autocomplete/username.js';
|
import usernameAutocomplete from '../core/autocomplete/username.js';
|
||||||
import getBlitzAccount from '../core/blitz/getBlitzAccount.js';
|
import getBlitzAccount from '../core/blitz/getBlitzAccount.js';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||||
@@ -100,7 +100,7 @@ export default {
|
|||||||
TANK_TYPE_EMOJIS['AT-SPG']
|
TANK_TYPE_EMOJIS['AT-SPG']
|
||||||
} = Tank Destroyer`,
|
} = Tank Destroyer`,
|
||||||
)
|
)
|
||||||
.setColor(SKILLED_COLOR),
|
.setColor(INFO_COLOR),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import getBlitzAccount from '../core/blitz/getBlitzAccount.js';
|
|||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||||
import cleanTable, { TableInputEntry } from '../core/interaction/cleanTable.js';
|
import cleanTable, { TableInputEntry } from '../core/interaction/cleanTable.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
import sklldEmbed from '../core/interaction/sklldEmbed.js';
|
import infoEmbed from '../core/interaction/infoEmbed.js';
|
||||||
import addUsernameOption from '../core/options/addUsernameOption.js';
|
import addUsernameOption from '../core/options/addUsernameOption.js';
|
||||||
import { args } from '../core/process/args.js';
|
import { args } from '../core/process/args.js';
|
||||||
import { CommandRegistry } from '../events/interactionCreate.js';
|
import { CommandRegistry } from '../events/interactionCreate.js';
|
||||||
@@ -57,7 +57,7 @@ export default {
|
|||||||
|
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
sklldEmbed(
|
infoEmbed(
|
||||||
`${markdownEscape(accounts[id].nickname)}'s information`,
|
`${markdownEscape(accounts[id].nickname)}'s information`,
|
||||||
|
|
||||||
cleanTable(
|
cleanTable(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import getBlitzAccount from '../core/blitz/getBlitzAccount.js';
|
|||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||||
import cleanTable from '../core/interaction/cleanTable.js';
|
import cleanTable from '../core/interaction/cleanTable.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
import sklldEmbed from '../core/interaction/sklldEmbed.js';
|
import infoEmbed from '../core/interaction/infoEmbed.js';
|
||||||
import addUsernameOption from '../core/options/addUsernameOption.js';
|
import addUsernameOption from '../core/options/addUsernameOption.js';
|
||||||
import { args } from '../core/process/args.js';
|
import { args } from '../core/process/args.js';
|
||||||
import { CommandRegistry } from '../events/interactionCreate.js';
|
import { CommandRegistry } from '../events/interactionCreate.js';
|
||||||
@@ -34,7 +34,7 @@ export default {
|
|||||||
|
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
sklldEmbed(
|
infoEmbed(
|
||||||
`${markdownEscape(accountInfo.nickname)}'s information`,
|
`${markdownEscape(accountInfo.nickname)}'s information`,
|
||||||
|
|
||||||
cleanTable([
|
cleanTable([
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import markdownEscape from 'markdown-escape';
|
|||||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
import sklldEmbed from '../core/interaction/sklldEmbed.js';
|
import infoEmbed from '../core/interaction/infoEmbed.js';
|
||||||
import addClanChoices from '../core/options/addClanChoices.js';
|
import addClanChoices from '../core/options/addClanChoices.js';
|
||||||
import addServerChoices from '../core/options/addServerChoices.js';
|
import addServerChoices from '../core/options/addServerChoices.js';
|
||||||
import { args } from '../core/process/args.js';
|
import { args } from '../core/process/args.js';
|
||||||
@@ -12,7 +12,7 @@ import { ClanList } from '../types/clanList.js';
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
inProduction: true,
|
inProduction: true,
|
||||||
inDevelopment: true,
|
inDevelopment: false,
|
||||||
inPublic: true,
|
inPublic: true,
|
||||||
|
|
||||||
command: new SlashCommandBuilder()
|
command: new SlashCommandBuilder()
|
||||||
@@ -39,7 +39,7 @@ export default {
|
|||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
sklldEmbed(
|
infoEmbed(
|
||||||
`Clan search for "${markdownEscape(clan)}" in ${
|
`Clan search for "${markdownEscape(clan)}" in ${
|
||||||
BLITZ_SERVERS[server]
|
BLITZ_SERVERS[server]
|
||||||
}`,
|
}`,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { SKILLED_COLOR } from '../constants/colors.js';
|
import { INFO_COLOR } from '../constants/colors.js';
|
||||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
@@ -42,7 +42,7 @@ export default {
|
|||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setColor(SKILLED_COLOR)
|
.setColor(INFO_COLOR)
|
||||||
.setTitle(
|
.setTitle(
|
||||||
`Player search for "${markdownEscape(name)}" in ${
|
`Player search for "${markdownEscape(name)}" in ${
|
||||||
BLITZ_SERVERS[server]
|
BLITZ_SERVERS[server]
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { go } from 'fuzzysort';
|
|||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { tankNames } from '../core/blitzstars/tankopedia.js';
|
import { tankNames } from '../core/blitzstars/tankopedia.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
import sklldEmbed from '../core/interaction/sklldEmbed.js';
|
import infoEmbed from '../core/interaction/infoEmbed.js';
|
||||||
import addTankChoices from '../core/options/addTankChoices.js';
|
import addTankChoices from '../core/options/addTankChoices.js';
|
||||||
import { CommandRegistry } from '../events/interactionCreate.js';
|
import { CommandRegistry } from '../events/interactionCreate.js';
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ export default {
|
|||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
sklldEmbed(
|
infoEmbed(
|
||||||
`Tank search for "${markdownEscape(tank)}"`,
|
`Tank search for "${markdownEscape(tank)}"`,
|
||||||
results.length === 0
|
results.length === 0
|
||||||
? 'No tanks found.'
|
? 'No tanks found.'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||||
import markdownEscape from 'markdown-escape';
|
import markdownEscape from 'markdown-escape';
|
||||||
import { SKILLED_COLOR } from '../constants/colors.js';
|
import { INFO_COLOR } from '../constants/colors.js';
|
||||||
import usernameAutocomplete from '../core/autocomplete/username.js';
|
import usernameAutocomplete from '../core/autocomplete/username.js';
|
||||||
import getBlitzAccount from '../core/blitz/getBlitzAccount.js';
|
import getBlitzAccount from '../core/blitz/getBlitzAccount.js';
|
||||||
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
import getWargamingResponse from '../core/blitz/getWargamingResponse.js';
|
||||||
@@ -103,7 +103,7 @@ export default {
|
|||||||
embeds: [
|
embeds: [
|
||||||
poweredByBlitzStars(
|
poweredByBlitzStars(
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setColor(SKILLED_COLOR)
|
.setColor(INFO_COLOR)
|
||||||
.setTitle(
|
.setTitle(
|
||||||
`${markdownEscape(blitzStarsAccount.nickname)}'s ${
|
`${markdownEscape(blitzStarsAccount.nickname)}'s ${
|
||||||
period === 'career'
|
period === 'career'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import getPeriodicStats, {
|
|||||||
import cleanTable from '../core/interaction/cleanTable.js';
|
import cleanTable from '../core/interaction/cleanTable.js';
|
||||||
import cmdName from '../core/interaction/cmdName.js';
|
import cmdName from '../core/interaction/cmdName.js';
|
||||||
import errorEmbed from '../core/interaction/errorEmbed.js';
|
import errorEmbed from '../core/interaction/errorEmbed.js';
|
||||||
import sklldEmbed from '../core/interaction/sklldEmbed.js';
|
import infoEmbed from '../core/interaction/infoEmbed.js';
|
||||||
import addTankChoices from '../core/options/addTankChoices.js';
|
import addTankChoices from '../core/options/addTankChoices.js';
|
||||||
import addUsernameOption from '../core/options/addUsernameOption.js';
|
import addUsernameOption from '../core/options/addUsernameOption.js';
|
||||||
import { args } from '../core/process/args.js';
|
import { args } from '../core/process/args.js';
|
||||||
@@ -79,7 +79,7 @@ export default {
|
|||||||
|
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
sklldEmbed(
|
infoEmbed(
|
||||||
`${period} day stats for ${markdownEscape(
|
`${period} day stats for ${markdownEscape(
|
||||||
accountInfo[id].nickname,
|
accountInfo[id].nickname,
|
||||||
)}'s ${resolveTankName(tank)}`,
|
)}'s ${resolveTankName(tank)}`,
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export const SKILLED_COLOR = '#8e3cf5';
|
export const INFO_COLOR = '#8e3cf5';
|
||||||
export const POSITIVE_COLOR = '#82ff29';
|
export const POSITIVE_COLOR = '#82ff29';
|
||||||
export const NEGATIVE_COLOR = '#ff4747';
|
export const NEGATIVE_COLOR = '#ff4747';
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { EmbedBuilder } from 'discord.js';
|
||||||
|
import { INFO_COLOR } from '../../constants/colors.js';
|
||||||
|
|
||||||
|
export default function infoEmbed(title: string, description: string) {
|
||||||
|
return new EmbedBuilder()
|
||||||
|
.setColor(INFO_COLOR)
|
||||||
|
.setTitle(title)
|
||||||
|
.setDescription(description);
|
||||||
|
}
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import { EmbedBuilder } from 'discord.js';
|
|
||||||
import { SKILLED_COLOR } from '../../constants/colors.js';
|
|
||||||
|
|
||||||
export default function sklldEmbed(title: string, description: string) {
|
|
||||||
return new EmbedBuilder()
|
|
||||||
.setColor(SKILLED_COLOR)
|
|
||||||
.setTitle(title)
|
|
||||||
.setDescription(description);
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { EmbedBuilder, GuildMember, TextChannel } from 'discord.js';
|
import { EmbedBuilder, GuildMember, TextChannel } from 'discord.js';
|
||||||
import discord from '../../discord.json' assert { type: 'json' };
|
import discord from '../../discord.json' assert { type: 'json' };
|
||||||
import { SKILLED_COLOR } from '../constants/colors.js';
|
import { INFO_COLOR } from '../constants/colors.js';
|
||||||
|
|
||||||
export default async function (member: GuildMember) {
|
export default async function (member: GuildMember) {
|
||||||
if (member.guild.id === discord.sklld_guild_id) {
|
if (member.guild.id === discord.sklld_guild_id) {
|
||||||
@@ -12,7 +12,7 @@ export default async function (member: GuildMember) {
|
|||||||
content: member.toString(),
|
content: member.toString(),
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
.setColor(SKILLED_COLOR)
|
.setColor(INFO_COLOR)
|
||||||
.setTitle(`Welcome ${member.user.username}`)
|
.setTitle(`Welcome ${member.user.username}`)
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`Welcome to the Skilled server, **${member.user.username}**! To continue, please use the \`/verify\` command.\n\nExample: \`/verify Europe Sabina244\``,
|
`Welcome to the Skilled server, **${member.user.username}**! To continue, please use the \`/verify\` command.\n\nExample: \`/verify Europe Sabina244\``,
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ import getClientId from '../core/process/getClientId.js';
|
|||||||
import isDev from '../core/process/isDev.js';
|
import isDev from '../core/process/isDev.js';
|
||||||
|
|
||||||
export interface CommandRegistry {
|
export interface CommandRegistry {
|
||||||
inDevelopment: boolean; // register with Skilled Bot (default: false)
|
inDevelopment: boolean;
|
||||||
inProduction: boolean; // register with Skilled Canary (default: false)
|
inProduction: boolean;
|
||||||
inPublic: boolean; // registers on all servers (default: true)
|
inPublic: boolean;
|
||||||
|
|
||||||
command: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
command: Omit<SlashCommandBuilder, 'addSubcommand' | 'addSubcommandGroup'>;
|
||||||
execute: (interaction: ChatInputCommandInteraction<CacheType>) => void;
|
execute: (interaction: ChatInputCommandInteraction<CacheType>) => void;
|
||||||
|
|||||||
Reference in new issue
Block a user