You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
512 B
15 lines
512 B
import {REST, Routes} from 'discord.js';
|
|
import {loadCommands} from "./command";
|
|
|
|
require("dotenv").config();
|
|
|
|
let token = process.env["DISCORD_TOKEN"] as string;
|
|
let clientId = process.env["CLIENT_ID"] as string;
|
|
let guildId = process.env["GUILD_ID"] as string;
|
|
|
|
const rest = new REST().setToken(token);
|
|
|
|
loadCommands().then(async commands => {
|
|
let cmdData = Array.from(commands.values()).map(cmd => cmd.data.toJSON());
|
|
await rest.put(Routes.applicationGuildCommands(clientId, guildId), {body: cmdData});
|
|
});
|
|
|