31 lines
747 B
TypeScript
31 lines
747 B
TypeScript
import { client, rest } from "../api.js"
|
|
import {
|
|
ApplicationCommandType,
|
|
RESTPutAPIApplicationGuildCommandsJSONBody,
|
|
Routes,
|
|
} from "discord-api-types/v10"
|
|
import { getAppIdFromToken } from "./appid.js"
|
|
import { config } from "../config.js"
|
|
|
|
export const syncCommands = async () => {
|
|
console.log("Syncing commands...")
|
|
for (const guild of config.guilds) {
|
|
console.log("Syncing for", guild)
|
|
await client.api.applicationCommands.bulkOverwriteGuildCommands(
|
|
getAppIdFromToken(config.token),
|
|
guild,
|
|
commands
|
|
)
|
|
}
|
|
|
|
console.log("------------ Done! ------------")
|
|
}
|
|
|
|
const commands: RESTPutAPIApplicationGuildCommandsJSONBody = [
|
|
{
|
|
type: ApplicationCommandType.ChatInput,
|
|
name: "start",
|
|
description: "start recording",
|
|
},
|
|
]
|