Pepperbot initializing
This commit is contained in:
commit
18c5085262
20 changed files with 2762 additions and 0 deletions
52
src/register-commands.js
Normal file
52
src/register-commands.js
Normal file
|
@ -0,0 +1,52 @@
|
|||
require('dotenv').config();
|
||||
const { REST, Routes, ApplicationCommandOptionType } = require('discord.js');
|
||||
|
||||
export const commands = [
|
||||
{
|
||||
name: 'say',
|
||||
description: 'forces bot to say message',
|
||||
options: [
|
||||
{
|
||||
name: 'message',
|
||||
description: 'the message',
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'administer',
|
||||
description: 'administer.',
|
||||
options: [
|
||||
{
|
||||
name: 'password',
|
||||
description: 'the protections.',
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'commands',
|
||||
description: 'sends a command list',
|
||||
},
|
||||
{
|
||||
name: 'test',
|
||||
description: 'test command',
|
||||
},
|
||||
];
|
||||
|
||||
const rest = new REST({ version: '10' }).setToken(process.env.TOKEN);
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(process.env.CLIENT_ID, process.env.GUILD_ID),
|
||||
{ body: commands }
|
||||
)
|
||||
|
||||
console.log("slash commands registered")
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue