aboutsummaryrefslogtreecommitdiff
path: root/commands.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands.js')
-rw-r--r--commands.js45
1 files changed, 27 insertions, 18 deletions
diff --git a/commands.js b/commands.js
index 91d782a..e7fb92a 100644
--- a/commands.js
+++ b/commands.js
@@ -1,30 +1,37 @@
-import 'dotenv/config';
+import "dotenv/config";
-import { REST, Routes } from 'discord.js';
+import { REST, Routes } from "discord.js";
const commands = [
{
- name: 'pet',
- description: 'pet sily bot',
+ name: "help",
+ description: "get help",
type: 1,
integration_types: [0],
contexts: [0],
},
{
- name: 'schedule_message',
- description: 'Register a message to run as a cron job',
+ name: "pet",
+ description: "pet sily bot",
+ type: 1,
+ integration_types: [0],
+ contexts: [0],
+ },
+ {
+ name: "schedule_message",
+ description: "Register a message to run as a cron job",
type: 1,
options: [
{
type: 3,
- name: 'message',
- description: 'the message to send',
+ name: "message",
+ description: "the message to send",
required: true,
},
{
type: 3,
- name: 'crontab',
- description: 'the schedule for the message',
+ name: "crontab",
+ description: "the schedule for the message",
required: true,
},
],
@@ -32,14 +39,14 @@ const commands = [
contexts: [0],
},
{
- name: 'unschedule_message',
- description: 'Stop sending a scheduled message',
+ name: "unschedule_message",
+ description: "Stop sending a scheduled message",
type: 1,
options: [
{
type: 3,
- name: 'id',
- description: 'the id of the message to stop',
+ name: "id",
+ description: "the id of the message to stop",
required: true,
},
],
@@ -48,14 +55,16 @@ const commands = [
},
];
-const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN);
+const rest = new REST({ version: "10" }).setToken(process.env.DISCORD_TOKEN);
try {
- console.log('Started refreshing application commands.');
+ console.log("Started refreshing application commands.");
- await rest.put(Routes.applicationCommands(process.env.APP_ID), { body: commands });
+ await rest.put(Routes.applicationCommands(process.env.APP_ID), {
+ body: commands,
+ });
- console.log('Successfully reloaded application commands.');
+ console.log("Successfully reloaded application commands.");
} catch (error) {
console.error(error);
}