feat: disable tools on opentest

This commit is contained in:
TrèsAbhi committed 2024-08-27 14:55:43 -05:00
1 parent 48dcbbc227
commit b9c978548a
20 files changed
+107 -99

No files matched your search

+1
View File
@@ -108,6 +108,7 @@
"noout", "noout",
"normalmap", "normalmap",
"Oopsy", "Oopsy",
"opentest",
"OPTML", "OPTML",
"outdir", "outdir",
"outfile", "outfile",
+5 -5
View File
@@ -5,7 +5,7 @@ import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
import { readStringDVPL } from '../src/core/blitz/readStringDVPL'; import { readStringDVPL } from '../src/core/blitz/readStringDVPL';
import { readYAMLDVPL } from '../src/core/blitz/readYAMLDVPL'; import { readYAMLDVPL } from '../src/core/blitz/readYAMLDVPL';
import { writeDVPL } from '../src/core/blitz/writeDVPL'; import { writeDVPL } from '../src/core/blitz/writeDVPL';
import { assertSecrete } from '../src/core/blitzkit/secrete'; import { assertSecret } from '../src/core/blitzkit/secret';
import { dvp } from '../submodules/blitzkit-closed/src/dvp'; import { dvp } from '../submodules/blitzkit-closed/src/dvp';
import { DATA } from './buildAssets/constants'; import { DATA } from './buildAssets/constants';
@@ -21,7 +21,7 @@ console.log(`Installing patches for ${currentVersion}...`);
let patchIndex = 1; let patchIndex = 1;
while (true) { while (true) {
const response = await fetch( const response = await fetch(
`${assertSecrete(process.env.WOTB_DLC_CDN)}/dlc/s${currentVersion}_${patchIndex}.yaml`, `${assertSecret(process.env.WOTB_DLC_CDN)}/dlc/s${currentVersion}_${patchIndex}.yaml`,
); );
if (response.status === 200) { if (response.status === 200) {
@@ -29,10 +29,10 @@ while (true) {
const data = parseYaml(await response.text()); const data = parseYaml(await response.text());
const dvpm = await fetch( const dvpm = await fetch(
`${assertSecrete(process.env.WOTB_DLC_CDN)}/dlc/${data.dx11}`, `${assertSecret(process.env.WOTB_DLC_CDN)}/dlc/${data.dx11}`,
).then((response) => response.arrayBuffer()); ).then((response) => response.arrayBuffer());
const dvpd = await fetch( const dvpd = await fetch(
`${assertSecrete(process.env.WOTB_DLC_CDN)}/dlc/${data.dx11.replace('.dvpm', '.dvpd')}`, `${assertSecret(process.env.WOTB_DLC_CDN)}/dlc/${data.dx11.replace('.dvpm', '.dvpd')}`,
).then((response) => response.arrayBuffer()); ).then((response) => response.arrayBuffer());
const files = await dvp(dvpm, dvpd); const files = await dvp(dvpm, dvpd);
const bar = new ProgressBar( const bar = new ProgressBar(
@@ -58,7 +58,7 @@ while (true) {
console.log('Found dynamic content localizations; patching...'); console.log('Found dynamic content localizations; patching...');
const localizationsResponse = await fetch( const localizationsResponse = await fetch(
`${assertSecrete(process.env.WOTB_DLC_CDN)}/dlc/${data.dynamicContentLocalizationsDir}/en.yaml`, `${assertSecret(process.env.WOTB_DLC_CDN)}/dlc/${data.dynamicContentLocalizationsDir}/en.yaml`,
); );
const newStrings = parseYaml(await localizationsResponse.text()); const newStrings = parseYaml(await localizationsResponse.text());
const oldStrings = await readYAMLDVPL<Record<string, string>>( const oldStrings = await readYAMLDVPL<Record<string, string>>(
+2 -2
View File
@@ -2,7 +2,7 @@ import sharp from 'sharp';
import { readDVPLFile } from '../../src/core/blitz/readDVPLFile'; import { readDVPLFile } from '../../src/core/blitz/readDVPLFile';
import { commitAssets } from '../../src/core/blitzkit/commitAssets'; import { commitAssets } from '../../src/core/blitzkit/commitAssets';
import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles'; import { FileChange } from '../../src/core/blitzkit/commitMultipleFiles';
import { assertSecrete } from '../../src/core/blitzkit/secrete'; import { assertSecret } from '../../src/core/blitzkit/secret';
import { DATA } from './constants'; import { DATA } from './constants';
const ICONS = [ const ICONS = [
@@ -45,7 +45,7 @@ export async function currencies() {
}), }),
); );
const glossary = await fetch(assertSecrete(process.env.WOTB_GLOSSARY)).then( const glossary = await fetch(assertSecret(process.env.WOTB_GLOSSARY)).then(
(response) => response.json() as Promise<BlitzGlossary>, (response) => response.json() as Promise<BlitzGlossary>,
); );
+4 -4
View File
@@ -1,5 +1,5 @@
import { NextResponse } from 'next/server'; import { NextResponse } from 'next/server';
import { assertSecrete } from '../../../../../core/blitzkit/secrete'; import { assertSecret } from '../../../../../core/blitzkit/secret';
export async function GET( export async function GET(
request: Request, request: Request,
@@ -8,11 +8,11 @@ export async function GET(
const response = await fetch( const response = await fetch(
`https://www.patreon.com/api/oauth2/token?code=${ `https://www.patreon.com/api/oauth2/token?code=${
params.code params.code
}&grant_type=authorization_code&client_id=${assertSecrete( }&grant_type=authorization_code&client_id=${assertSecret(
process.env.NEXT_PUBLIC_PATREON_CLIENT_ID, process.env.NEXT_PUBLIC_PATREON_CLIENT_ID,
)}&client_secret=${assertSecrete( )}&client_secret=${assertSecret(
process.env.PATREON_CLIENT_SECRET, process.env.PATREON_CLIENT_SECRET,
)}&redirect_uri=${assertSecrete(process.env.NEXT_PUBLIC_PATREON_REDIRECT_URI)}`, )}&redirect_uri=${assertSecret(process.env.NEXT_PUBLIC_PATREON_REDIRECT_URI)}`,
{ {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
@@ -1,5 +1,5 @@
import { NextResponse } from 'next/server'; import { NextResponse } from 'next/server';
import { assertSecrete } from '../../../../../core/blitzkit/secrete'; import { assertSecret } from '../../../../../core/blitzkit/secret';
interface PatreonMembershipResponse { interface PatreonMembershipResponse {
data: { data: {
@@ -69,7 +69,7 @@ export async function GET(
(item) => (item) =>
item.type === 'member' && item.type === 'member' &&
item.relationships.campaign.data.id === item.relationships.campaign.data.id ===
assertSecrete(process.env.PATREON_CAMPAIGN_ID) && assertSecret(process.env.PATREON_CAMPAIGN_ID) &&
item.attributes.patron_status === 'active_patron', item.attributes.patron_status === 'active_patron',
), ),
); );
+3 -3
View File
@@ -1,5 +1,5 @@
import { NextResponse } from 'next/server'; import { NextResponse } from 'next/server';
import { assertSecrete } from '../../../../../core/blitzkit/secrete'; import { assertSecret } from '../../../../../core/blitzkit/secret';
export async function GET( export async function GET(
request: Request, request: Request,
@@ -8,9 +8,9 @@ export async function GET(
const response = await fetch( const response = await fetch(
`https://www.patreon.com/api/oauth2/token?grant_type=refresh_token&refresh_token=${ `https://www.patreon.com/api/oauth2/token?grant_type=refresh_token&refresh_token=${
params.token params.token
}&client_id=${assertSecrete( }&client_id=${assertSecret(
process.env.NEXT_PUBLIC_PATREON_CLIENT_ID, process.env.NEXT_PUBLIC_PATREON_CLIENT_ID,
)}&client_secret=${assertSecrete(process.env.PATREON_CLIENT_SECRET)}`, )}&client_secret=${assertSecret(process.env.PATREON_CLIENT_SECRET)}`,
{ method: 'POST' }, { method: 'POST' },
); );
const json = await response.json(); const json = await response.json();
+40 -55
View File
@@ -2,14 +2,16 @@ import { CaretRightIcon } from '@radix-ui/react-icons';
import { import {
Box, Box,
Button, Button,
Code,
Flex, Flex,
FlexProps, FlexProps,
Heading, Heading,
Link,
Text, Text,
} from '@radix-ui/themes'; } from '@radix-ui/themes';
import { Link } from '../../components/Link';
import { Tool } from '../../constants/tools'; import { Tool } from '../../constants/tools';
import { ImgurSize, imgur } from '../../core/blitzkit/imgur'; import { ImgurSize, imgur } from '../../core/blitzkit/imgur';
import { assertSecret } from '../../core/blitzkit/secret';
type ToolCardProps = FlexProps & { type ToolCardProps = FlexProps & {
tool: Tool; tool: Tool;
@@ -19,10 +21,14 @@ export function ToolCard({ tool, style, ...props }: ToolCardProps) {
const size = tool.significant const size = tool.significant
? ImgurSize.HugeThumbnail ? ImgurSize.HugeThumbnail
: ImgurSize.LargeThumbnail; : ImgurSize.LargeThumbnail;
const unavailableOnBranch = tool.branches?.every(
(branch) => branch !== assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH),
);
return ( return (
<Flex <Flex
style={{ style={{
opacity: unavailableOnBranch ? 0.25 : 1,
position: 'relative', position: 'relative',
borderRadius: 'var(--radius-2)', borderRadius: 'var(--radius-2)',
overflow: 'hidden', overflow: 'hidden',
@@ -33,17 +39,11 @@ export function ToolCard({ tool, style, ...props }: ToolCardProps) {
...style, ...style,
}} }}
flexGrow={tool.significant ? undefined : '1'} flexGrow={tool.significant ? undefined : '1'}
flexBasis={ flexBasis={tool.significant ? undefined : { initial: undefined, sm: '0' }}
tool.significant
? undefined
: {
initial: undefined,
sm: '0',
}
}
{...props} {...props}
> >
<Link <Link
disabled={unavailableOnBranch}
href={tool.href ?? `/tools/${tool.id}`} href={tool.href ?? `/tools/${tool.id}`}
target={tool.href ? '_blank' : undefined} target={tool.href ? '_blank' : undefined}
style={{ style={{
@@ -65,22 +65,13 @@ export function ToolCard({ tool, style, ...props }: ToolCardProps) {
/> />
<Flex <Flex
px={{ px={{ initial: '6', md: tool.significant ? '8' : '6' }}
initial: '6', py={{ initial: '4', sm: tool.significant ? '6' : '4' }}
md: tool.significant ? '8' : '6',
}}
py={{
initial: '4',
sm: tool.significant ? '6' : '4',
}}
gap="4" gap="4"
align="center" align="center"
justify="between" justify="between"
width="100%" width="100%"
direction={{ direction={{ initial: 'column', xs: 'row' }}
initial: 'column',
xs: 'row',
}}
style={{ style={{
backgroundColor: 'var(--color-panel-translucent)', backgroundColor: 'var(--color-panel-translucent)',
backdropFilter: 'blur(64px)', backdropFilter: 'blur(64px)',
@@ -90,52 +81,46 @@ export function ToolCard({ tool, style, ...props }: ToolCardProps) {
<Flex <Flex
direction="column" direction="column"
justify="center" justify="center"
align={{ align={{ initial: 'center', xs: 'start' }}
initial: 'center',
xs: 'start',
}}
> >
<Heading <Heading
align={{ align={{ initial: 'center', sm: 'left' }}
initial: 'center', size={{ initial: '6', sm: tool.significant ? '7' : '5' }}
sm: 'left',
}}
size={{
initial: '6',
sm: tool.significant ? '7' : '5',
}}
weight="medium" weight="medium"
> >
{tool.title} {tool.title}
</Heading> </Heading>
<Text <Text
align={{ align={{ initial: 'center', sm: 'left' }}
initial: 'center', size={{ initial: '3', sm: tool.significant ? '4' : '3' }}
sm: 'left',
}}
size={{
initial: '3',
sm: tool.significant ? '4' : '3',
}}
color="gray" color="gray"
> >
{tool.description} {unavailableOnBranch ? (
<>
Unavailable on{' '}
<Code>
{assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH)}
</Code>
</>
) : (
tool.description
)}
</Text> </Text>
</Flex> </Flex>
<Button {!unavailableOnBranch && (
size={{ <Button
initial: undefined, size={{
sm: tool.significant ? '3' : undefined, initial: undefined,
}} sm: tool.significant ? '3' : undefined,
color={tool.button.color} }}
style={{ color={tool.button.color}
cursor: 'inherit', style={{ cursor: 'inherit' }}
}} >
> {tool.button.text}
{tool.button.text} <CaretRightIcon />
<CaretRightIcon /> </Button>
</Button> )}
</Flex> </Flex>
</Link> </Link>
</Flex> </Flex>
+2 -2
View File
@@ -3,7 +3,7 @@ import Markdown from 'markdown-to-jsx';
import { use } from 'react'; import { use } from 'react';
import { Link } from '../../../../components/Link'; import { Link } from '../../../../components/Link';
import PageWrapper from '../../../../components/PageWrapper'; import PageWrapper from '../../../../components/PageWrapper';
import { assertSecrete } from '../../../../core/blitzkit/secrete'; import { assertSecret } from '../../../../core/blitzkit/secret';
export default function Page({ export default function Page({
params, params,
@@ -12,7 +12,7 @@ export default function Page({
}) { }) {
const markdown = use( const markdown = use(
fetch( fetch(
`https://raw.githubusercontent.com/tresabhi/blitzkit/${assertSecrete( `https://raw.githubusercontent.com/tresabhi/blitzkit/${assertSecret(
process.env.NEXT_PUBLIC_ASSET_BRANCH, process.env.NEXT_PUBLIC_ASSET_BRANCH,
)}/docs/${params.directory}/${params.document}.md`, )}/docs/${params.directory}/${params.document}.md`,
).then((response) => response.text()), ).then((response) => response.text()),
+17 -3
View File
@@ -1,19 +1,33 @@
'use client'; 'use client';
import { LinkProps, Link as RadixLink } from '@radix-ui/themes'; import {
Link as RadixLink,
LinkProps as RadixLinkProps,
} from '@radix-ui/themes';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import { forwardRef } from 'react'; import { forwardRef } from 'react';
type LinkProps = RadixLinkProps & {
disabled?: boolean;
};
export const Link = forwardRef<HTMLAnchorElement, LinkProps>( export const Link = forwardRef<HTMLAnchorElement, LinkProps>(
({ href, onClick, target, ...props }, ref) => { ({ href, onClick, target, disabled, style, ...props }, ref) => {
const router = useRouter(); const router = useRouter();
return ( return (
<RadixLink <RadixLink
style={{
cursor: disabled ? 'not-allowed' : 'pointer',
...style,
}}
ref={ref} ref={ref}
href={href} href={disabled ? undefined : href}
onClick={(event) => { onClick={(event) => {
if (disabled) return;
event.preventDefault(); event.preventDefault();
if (href) { if (href) {
if (event.ctrlKey || event.metaKey || target === '_blank') { if (event.ctrlKey || event.metaKey || target === '_blank') {
window.open(href); window.open(href);
+8
View File
@@ -14,6 +14,7 @@ export interface Tool {
color: ComponentProps<typeof Button>['color']; color: ComponentProps<typeof Button>['color'];
}; };
significant?: boolean; significant?: boolean;
branches?: string[];
} }
export const tankopediaTool: Tool = { export const tankopediaTool: Tool = {
@@ -28,6 +29,7 @@ export const tankopediaTool: Tool = {
color: 'purple', color: 'purple',
}, },
significant: true, significant: true,
branches: ['main', 'dev', 'opentest'],
}; };
export const ratingTool: Tool = { export const ratingTool: Tool = {
@@ -41,6 +43,7 @@ export const ratingTool: Tool = {
text: 'View leaderboard', text: 'View leaderboard',
color: 'orange', color: 'orange',
}, },
branches: ['main', 'dev'],
}; };
export const compareTool: Tool = { export const compareTool: Tool = {
@@ -54,6 +57,7 @@ export const compareTool: Tool = {
text: 'Compare tanks', text: 'Compare tanks',
color: 'crimson', color: 'crimson',
}, },
branches: ['main', 'dev', 'opentest'],
}; };
export const sessionTool: Tool = { export const sessionTool: Tool = {
@@ -68,6 +72,7 @@ export const sessionTool: Tool = {
text: 'Start tracking', text: 'Start tracking',
color: 'blue', color: 'blue',
}, },
branches: ['main', 'dev'],
}; };
export const discordTool: Tool = { export const discordTool: Tool = {
@@ -105,6 +110,7 @@ export const playerStatsTool: Tool = {
}, },
image: 'YelSOfT', image: 'YelSOfT',
href: '_', // TODO: remove this to re-enable link href: '_', // TODO: remove this to re-enable link
branches: ['main', 'dev'],
}; };
export const tankPerformanceTool: Tool = { export const tankPerformanceTool: Tool = {
@@ -117,6 +123,7 @@ export const tankPerformanceTool: Tool = {
color: 'jade', color: 'jade',
}, },
image: 'vOKFB03', image: 'vOKFB03',
branches: ['main', 'dev'],
}; };
export const embedTool: Tool = { export const embedTool: Tool = {
@@ -130,6 +137,7 @@ export const embedTool: Tool = {
color: 'red', color: 'red',
}, },
image: 'Q0faRYg', image: 'Q0faRYg',
branches: ['main', 'dev', 'opentest'],
}; };
export const homeTool: Tool = { export const homeTool: Tool = {
+2 -2
View File
@@ -1,8 +1,8 @@
import { ASSETS_REPO } from '../../constants/assets'; import { ASSETS_REPO } from '../../constants/assets';
import { assertSecrete } from './secrete'; import { assertSecret } from './secret';
export function asset(path: string) { export function asset(path: string) {
return `https://raw.githubusercontent.com/tresabhi/${ASSETS_REPO}/${assertSecrete( return `https://raw.githubusercontent.com/tresabhi/${ASSETS_REPO}/${assertSecret(
process.env.NEXT_PUBLIC_ASSET_BRANCH, process.env.NEXT_PUBLIC_ASSET_BRANCH,
)}/${path}`; )}/${path}`;
} }
+2 -2
View File
@@ -1,6 +1,6 @@
import { ASSETS_REPO } from '../../constants/assets'; import { ASSETS_REPO } from '../../constants/assets';
import commitMultipleFiles, { FileChange } from './commitMultipleFiles'; import commitMultipleFiles, { FileChange } from './commitMultipleFiles';
import { assertSecrete } from './secrete'; import { assertSecret } from './secret';
export async function commitAssets(message: string, changes: FileChange[]) { export async function commitAssets(message: string, changes: FileChange[]) {
console.log(`Committing ${message}...`); console.log(`Committing ${message}...`);
@@ -10,7 +10,7 @@ export async function commitAssets(message: string, changes: FileChange[]) {
await commitMultipleFiles( await commitMultipleFiles(
'tresabhi', 'tresabhi',
ASSETS_REPO, ASSETS_REPO,
assertSecrete(process.env.NEXT_PUBLIC_ASSET_BRANCH), assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH),
`${message} - ${new Date().toDateString()}`, `${message} - ${new Date().toDateString()}`,
changes, changes,
); );
+2 -2
View File
@@ -1,9 +1,9 @@
import { throttling } from '@octokit/plugin-throttling'; import { throttling } from '@octokit/plugin-throttling';
import { Octokit } from '@octokit/rest'; import { Octokit } from '@octokit/rest';
import { assertSecrete } from './secrete'; import { assertSecret } from './secret';
Octokit.plugin(throttling); Octokit.plugin(throttling);
export const octokit = new Octokit({ export const octokit = new Octokit({
auth: assertSecrete(process.env.GH_TOKEN), auth: assertSecret(process.env.GH_TOKEN),
}); });
+3 -3
View File
@@ -1,10 +1,10 @@
import { assertSecrete } from './secrete'; import { assertSecret } from './secret';
export function patreonLoginUrl() { export function patreonLoginUrl() {
const params = new URLSearchParams({ const params = new URLSearchParams({
response_type: 'code', response_type: 'code',
client_id: assertSecrete(process.env.NEXT_PUBLIC_PATREON_CLIENT_ID), client_id: assertSecret(process.env.NEXT_PUBLIC_PATREON_CLIENT_ID),
redirect_uri: assertSecrete(process.env.NEXT_PUBLIC_PATREON_REDIRECT_URI), redirect_uri: assertSecret(process.env.NEXT_PUBLIC_PATREON_REDIRECT_URI),
scope: 'identity', scope: 'identity',
}); });
+4
View File
@@ -0,0 +1,4 @@
export function assertSecret(secret?: string) {
if (secret === undefined) throw new Error('Missing secret');
return secret;
}
-4
View File
@@ -1,4 +0,0 @@
export function assertSecrete(secrete?: string) {
if (secrete === undefined) throw new Error('Missing secret');
return secrete;
}
+2 -2
View File
@@ -1,6 +1,6 @@
import { ShardingManager } from 'discord.js'; import { ShardingManager } from 'discord.js';
import { assertSecrete } from '../blitzkit/secrete'; import { assertSecret } from '../blitzkit/secret';
export const manager = new ShardingManager('dist/bot/workers/bot.js', { export const manager = new ShardingManager('dist/bot/workers/bot.js', {
token: assertSecrete(process.env.DISCORD_TOKEN), token: assertSecret(process.env.DISCORD_TOKEN),
}); });
+3 -3
View File
@@ -1,7 +1,7 @@
import { ASSETS_REPO } from '../../constants/assets'; import { ASSETS_REPO } from '../../constants/assets';
import { GithubChangeBlob, createBlob } from '../blitzkit/createBlob'; import { GithubChangeBlob, createBlob } from '../blitzkit/createBlob';
import { octokit } from '../blitzkit/octokit'; import { octokit } from '../blitzkit/octokit';
import { assertSecrete } from '../blitzkit/secrete'; import { assertSecret } from '../blitzkit/secret';
export class AssetCommit { export class AssetCommit {
constructor(public message: string) {} constructor(public message: string) {}
@@ -26,7 +26,7 @@ export class AssetCommit {
await octokit.git.getRef({ await octokit.git.getRef({
owner: 'tresabhi', owner: 'tresabhi',
repo: ASSETS_REPO, repo: ASSETS_REPO,
ref: `heads/${assertSecrete(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`, ref: `heads/${assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`,
}) })
).data.object.sha; ).data.object.sha;
const treeSha = ( const treeSha = (
@@ -54,7 +54,7 @@ export class AssetCommit {
await octokit.git.updateRef({ await octokit.git.updateRef({
owner: 'tresabhi', owner: 'tresabhi',
repo: ASSETS_REPO, repo: ASSETS_REPO,
ref: `heads/${assertSecrete(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`, ref: `heads/${assertSecret(process.env.NEXT_PUBLIC_ASSET_BRANCH)}`,
sha: newCommitData.sha, sha: newCommitData.sha,
}); });
} }
+3 -3
View File
@@ -33,7 +33,7 @@ import { searchPlayersCommand } from '../../commands/searchPlayers';
import { statsCommand } from '../../commands/stats'; import { statsCommand } from '../../commands/stats';
import { todayCommand } from '../../commands/today'; import { todayCommand } from '../../commands/today';
import { RenderConfiguration } from '../../core/blitzkit/renderConfiguration'; import { RenderConfiguration } from '../../core/blitzkit/renderConfiguration';
import { assertSecrete } from '../../core/blitzkit/secrete'; import { assertSecret } from '../../core/blitzkit/secret';
import handleAutocomplete from './handlers/autocomplete'; import handleAutocomplete from './handlers/autocomplete';
import handleButton from './handlers/button'; import handleButton from './handlers/button';
import handleChatInputCommand from './handlers/chatInputCommand'; import handleChatInputCommand from './handlers/chatInputCommand';
@@ -115,7 +115,7 @@ export const commands = Promise.allSettled(COMMANDS_RAW).then((rawCommands) => {
); );
}); });
const rest = new REST().setToken(assertSecrete(process.env.DISCORD_TOKEN)); const rest = new REST().setToken(assertSecret(process.env.DISCORD_TOKEN));
commands.then((awaitedCommands) => { commands.then((awaitedCommands) => {
const body = Object.values(awaitedCommands).map((registry) => const body = Object.values(awaitedCommands).map((registry) =>
@@ -123,7 +123,7 @@ commands.then((awaitedCommands) => {
); );
rest.put( rest.put(
Routes.applicationCommands(assertSecrete(process.env.DISCORD_CLIENT_ID)), Routes.applicationCommands(assertSecret(process.env.DISCORD_CLIENT_ID)),
{ {
body, body,
}, },
+2 -2
View File
@@ -1,9 +1,9 @@
import { registerProcesses } from '../core/blitzkit/processes'; import { registerProcesses } from '../core/blitzkit/processes';
import { assertSecrete } from '../core/blitzkit/secrete'; import { assertSecret } from '../core/blitzkit/secret';
import { client } from '../core/discord/client'; import { client } from '../core/discord/client';
console.log(`🟡 Launching bot ${client.shard?.ids[0]}`); console.log(`🟡 Launching bot ${client.shard?.ids[0]}`);
registerProcesses(); registerProcesses();
client.login(assertSecrete(process.env.DISCORD_TOKEN)); client.login(assertSecret(process.env.DISCORD_TOKEN));