This commit is contained in:
Lukian LEIZOUR 2023-03-02 16:26:41 +01:00
parent c997a4f034
commit 4afa276479
26 changed files with 1437 additions and 204 deletions

33
register-commands.js Normal file
View file

@ -0,0 +1,33 @@
const {REST , Routes, ApplicationCommandOptionType} = require('discord.js');
const commands = [
{
name: 'gptrequest',
description: 'Make a request to the GPT-3.5-Turbo API',
options: [
{
name: 'question',
description: 'The question you want to ask to the API',
type: ApplicationCommandOptionType.String,
required: true,
},
],
}
];
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD);
(async () => {
try {
console.log('Started refreshing application (/) commands.');
await rest.put(
Routes.applicationGuildCommands('1059559067846189067', '1062473997297668108'),
{ body: commands },
);
console.log('Successfully reloaded application (/) commands.');
} catch (error) {
console.error(error);
}
})();