chore: switch to pnpm and remove DISCORD_APP

This commit is contained in:
Ryan Cao 2023-06-05 18:13:48 +08:00
parent 930d7bca12
commit cb16991417
No known key found for this signature in database
10 changed files with 1692 additions and 1657 deletions

View file

@ -1,4 +1,9 @@
import { SlashCommandBuilder, Routes, PermissionFlagsBits } from 'discord.js';
import {
SlashCommandBuilder,
Routes,
PermissionFlagsBits,
type RESTGetAPIOAuth2CurrentApplicationResult,
} from 'discord.js';
import { REST } from '@discordjs/rest';
import { getTags } from './tags';
@ -62,7 +67,11 @@ export const reuploadCommands = async () => {
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!);
await rest.put(Routes.applicationCommands(process.env.DISCORD_APP!), {
const { id: appId } = (await rest.get(
Routes.oauth2CurrentApplication()
)) as RESTGetAPIOAuth2CurrentApplicationResult;
await rest.put(Routes.applicationCommands(appId), {
body: commands,
});