From 9c4e538aa0b41906b97b7ecc3317c23ba26b3246 Mon Sep 17 00:00:00 2001 From: jacob janzen <53062115+JacobJanzen@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:07:47 -0600 Subject: Add help message --- commands.js | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'commands.js') 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); } -- cgit v1.2.3