mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: migrate
This commit is contained in:
1 parent
02aed3e3a5
commit
5ae6961a13
7 files changed
+26
-14
No files matched your search
@@ -10,7 +10,7 @@ const fontsPromise = [
|
||||
{ file: robotoBold, weight: 700 as const },
|
||||
{ file: robotoBlack, weight: 900 as const },
|
||||
].map(async ({ file, weight }) => {
|
||||
const data = await readFile(`dist/bot/workers/${file}`);
|
||||
const data = await readFile(file);
|
||||
return { name: 'Roboto', weight, data };
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Worker } from 'worker_threads';
|
||||
const RENDER_WORKERS = 1;
|
||||
|
||||
const workers = [...Array(RENDER_WORKERS)].map(() => {
|
||||
const worker = new Worker('dist/bot/workers/render.js');
|
||||
const worker = new Worker('src/workers/render.ts');
|
||||
console.log(`🟡 Launching render worker ${worker.threadId}`);
|
||||
return worker;
|
||||
});
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { TANK_CLASSES, TREE_TYPES } from '@blitzkit/core';
|
||||
import {
|
||||
TANK_CLASSES,
|
||||
TANK_TYPE_COMMAND_NAMES,
|
||||
TANK_TYPES,
|
||||
} from '@blitzkit/core';
|
||||
import {
|
||||
APIApplicationCommandOptionChoice,
|
||||
Locale,
|
||||
@@ -87,10 +91,10 @@ export function addFilterOptions<
|
||||
),
|
||||
)
|
||||
.addChoices(
|
||||
...TREE_TYPES.map(
|
||||
...TANK_TYPES.map(
|
||||
(treeType) =>
|
||||
({
|
||||
value: treeType,
|
||||
value: TANK_TYPE_COMMAND_NAMES[treeType],
|
||||
name: translate(`common.tree_type.${treeType}`),
|
||||
name_localizations: localizationObject(
|
||||
`common.tree_type.${treeType}`,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { assertSecret } from '@blitzkit/core';
|
||||
import { ShardingManager } from 'discord.js';
|
||||
|
||||
export const manager = new ShardingManager('dist/bot/workers/bot.js', {
|
||||
export const manager = new ShardingManager('src/workers/bot.ts', {
|
||||
token: assertSecret(process.env.DISCORD_TOKEN),
|
||||
});
|
||||
@@ -13,7 +13,7 @@ export const translations = SUPPORTED_LOCALES.reduce<
|
||||
>(
|
||||
(table, locale) => ({
|
||||
...table,
|
||||
[locale]: require(`../lang/${locale}.json`),
|
||||
[locale]: require(`@blitzkit/core/lang/${locale}.json`),
|
||||
}),
|
||||
{},
|
||||
);
|
||||
Reference in new issue
Block a user