Initial commit
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
require('dotenv').config();
|
||||
const { REST, Routes } = require('discord.js');
|
||||
|
||||
const commands = [
|
||||
{
|
||||
name: 'addbirthday',
|
||||
description: 'Add your birthday',
|
||||
options: [
|
||||
{
|
||||
name: 'month',
|
||||
type: 4, // Integer
|
||||
description: 'The month of your birthday (1-12)',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'day',
|
||||
type: 4, // Integer
|
||||
description: 'The day of your birthday (1-31)',
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'viewbirthdays',
|
||||
description: 'View all saved birthdays',
|
||||
},
|
||||
{
|
||||
name: 'todaybirthdays',
|
||||
description: 'Check who has a birthday today',
|
||||
},
|
||||
];
|
||||
|
||||
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN);
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
console.log('Started refreshing application (/) commands.');
|
||||
|
||||
await rest.put(
|
||||
Routes.applicationGuildCommands(process.env.CLIENT_ID, process.env.GUILD_ID),
|
||||
{ body: commands }
|
||||
);
|
||||
|
||||
console.log('Successfully reloaded application (/) commands.');
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user