mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: switched to vite node
This commit is contained in:
1 parent
d9deeb3630
commit
8ff34f0bbb
14 files changed
+370
-222
No files matched your search
@@ -1,6 +1,10 @@
|
||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||
import discord from '../../discord.json' assert { type: 'json' };
|
||||
import { CommandRegistry } from '../behaviors/interactionCreate.js';
|
||||
import {
|
||||
CommandRegistry,
|
||||
guildCommands,
|
||||
publicCommands,
|
||||
} from '../behaviors/interactionCreate.js';
|
||||
import { SKILLED_COLOR } from '../constants/colors.js';
|
||||
|
||||
export default {
|
||||
@@ -12,7 +16,7 @@ export default {
|
||||
.setName('help')
|
||||
.setDescription('All the help you need about the bot'),
|
||||
|
||||
async execute(interaction, commandCollection) {
|
||||
async execute(interaction) {
|
||||
await interaction.reply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
@@ -21,11 +25,8 @@ export default {
|
||||
.setDescription(
|
||||
`**About**\nSkilled Bot automates many mundane tasks and provide statistics in numerous flexible ways.\n\nMade by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/sklld/bot\nSkilled: https://discord.gg/ZPvcEG7DS8\n\n**Commands**\n${(interaction.guildId ===
|
||||
discord.guild_id
|
||||
? [
|
||||
...commandCollection.guildCommands,
|
||||
...commandCollection.publicCommands,
|
||||
]
|
||||
: commandCollection.publicCommands
|
||||
? [...guildCommands, ...publicCommands]
|
||||
: publicCommands
|
||||
)
|
||||
.map((command) => `**/${command.name}**: ${command.description}`)
|
||||
.join(
|
||||
|
||||
@@ -4,6 +4,7 @@ import { NEGATIVE_COLOR, POSITIVE_COLOR } from '../constants/colors.js';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
||||
import { ClanInfo } from '../types/clanInfo.js';
|
||||
import { PlayerPersonalData } from '../types/playerPersonalData.js';
|
||||
import { args } from '../utilities/args.js';
|
||||
import getClan from '../utilities/getClan.js';
|
||||
import getWargamingResponse from '../utilities/getWargamingResponse.js';
|
||||
|
||||
@@ -53,14 +54,14 @@ export default {
|
||||
const time = new Date().getTime() / 1000;
|
||||
|
||||
getWargamingResponse<ClanInfo>(
|
||||
`https://api.wotblitz.com/wotb/clans/info/?application_id=${process.env.WARGAMING_APPLICATION_ID}&clan_id=${clan.clan_id}`,
|
||||
`https://api.wotblitz.com/wotb/clans/info/?application_id=${args['wargaming-application-id']}&clan_id=${clan.clan_id}`,
|
||||
interaction,
|
||||
async (clanInfo) => {
|
||||
const memberIds = clanInfo[clan.clan_id].members_ids;
|
||||
|
||||
getWargamingResponse<PlayerPersonalData>(
|
||||
`https://api.wotblitz.com/wotb/account/info/?application_id=${
|
||||
process.env.WARGAMING_APPLICATION_ID
|
||||
args['wargaming-application-id']
|
||||
}&account_id=${memberIds.join(',')}`,
|
||||
interaction,
|
||||
async (playerPersonalData) => {
|
||||
|
||||
@@ -3,6 +3,7 @@ import { CommandRegistry } from '../behaviors/interactionCreate.js';
|
||||
import { SKILLED_COLOR } from '../constants/colors.js';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
||||
import { TanksStats } from '../types/tanksStats.js';
|
||||
import { args } from '../utilities/args.js';
|
||||
import getBlitzAccount from '../utilities/getBlitzAccount.js';
|
||||
import getWargamingResponse from '../utilities/getWargamingResponse.js';
|
||||
import { TANK_TYPE_EMOJIS, tankopedia } from '../utilities/tankopedia.js';
|
||||
@@ -30,7 +31,7 @@ const COMP_TANKS = [
|
||||
|
||||
export default {
|
||||
inProduction: true,
|
||||
inDevelopment: true,
|
||||
inDevelopment: false,
|
||||
inPublic: true,
|
||||
|
||||
command: new SlashCommandBuilder()
|
||||
@@ -69,7 +70,7 @@ export default {
|
||||
|
||||
getBlitzAccount(interaction, name, server, async (account) => {
|
||||
getWargamingResponse<TanksStats>(
|
||||
`https://api.wotblitz.${server}/wotb/tanks/stats/?application_id=${process.env.WARGAMING_APPLICATION_ID}&account_id=${account.account_id}`,
|
||||
`https://api.wotblitz.${server}/wotb/tanks/stats/?application_id=${args['wargaming-application-id']}&account_id=${account.account_id}`,
|
||||
interaction,
|
||||
async (tankStats) => {
|
||||
const tanks = tankStats[account.account_id]!.map(
|
||||
|
||||
@@ -4,6 +4,7 @@ import { CommandRegistry } from '../behaviors/interactionCreate.js';
|
||||
import { NEGATIVE_COLOR, POSITIVE_COLOR } from '../constants/colors.js';
|
||||
import { BLITZ_SERVERS, BlitzServer } from '../constants/servers.js';
|
||||
import { PlayerClanData } from '../types/playerClanData.js';
|
||||
import { args } from '../utilities/args.js';
|
||||
import getBlitzAccount from '../utilities/getBlitzAccount.js';
|
||||
import getWargamingResponse from '../utilities/getWargamingResponse.js';
|
||||
|
||||
@@ -39,7 +40,7 @@ export default {
|
||||
|
||||
getBlitzAccount(interaction, name, server, async (account) => {
|
||||
getWargamingResponse<PlayerClanData>(
|
||||
`https://api.wotblitz.${server}/wotb/clans/accountinfo/?application_id=${process.env.WARGAMING_APPLICATION_ID}&account_id=${account.account_id}&extra=clan`,
|
||||
`https://api.wotblitz.${server}/wotb/clans/accountinfo/?application_id=${args['wargaming-application-id']}&account_id=${account.account_id}&extra=clan`,
|
||||
interaction,
|
||||
async (clanData) => {
|
||||
const clan = clanData[account.account_id].clan;
|
||||
|
||||
Reference in new issue
Block a user