From 36066ad3d8d92855bbfdf4273a53066c6092fa45 Mon Sep 17 00:00:00 2001 From: jacob janzen <53062115+JacobJanzen@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:28:09 -0600 Subject: add blep command (#4) --- app.js | 4 ++++ command_impls.js | 8 +++++++- commands.js | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index aee587c..f445a8f 100644 --- a/app.js +++ b/app.js @@ -7,6 +7,7 @@ import { } from "discord-interactions"; import { Client, GatewayIntentBits, ActivityType } from "discord.js"; import { + blep, help, pet, schedule_message, @@ -42,6 +43,9 @@ function handle_application_command(state, data, channel_id) { case "help": return help(state); + case "blep": + return blep(state); + default: console.error(`unknown command: ${name}`); return res.status(400).json({ error: "unknown command" }); diff --git a/command_impls.js b/command_impls.js index 3079e83..d10b293 100644 --- a/command_impls.js +++ b/command_impls.js @@ -41,8 +41,14 @@ export function help(state) { state, `Hi, I'm sily-bot! Here are the available commands and their descriptions: +- \`/blep\` blep. +- \`/help\` Show this message. - \`/pet\` You can pet sily-bot. -- \`/schedule-message \` Schedule a message to be send later. Works like Linux cron jobs in the format second minute hour day month weekday. Put the number (or name of month or weekday) in each spot. If you want it to run every second, minute, etc. instead of once when it reaches the provided number, use a * instead of a number. For instance, to run a job every minute on January 4th, you might use 0 * * 4 January *. The bot replies with a UUID that can be used to cancel the cron job later. +- \`/schedule-message \` Schedule a message to be send later. Works like Linux cron jobs in the format second minute hour day month weekday. Put the number (or name of month or weekday) in each spot. If you want it to run every second, minute, etc. instead of once when it reaches the provided number, use a \`*\` instead of a number. For instance, to run a job every minute on January 4th, you might use \`0 * * 4 January *\`. The bot replies with a UUID that can be used to cancel the cron job later. - \`/unschedule-message \` Stop sending a message with the given id.`, ); } + +export function blep(state) { + return send(state, `≽^•𐃷•^≼`); +} diff --git a/commands.js b/commands.js index e7fb92a..2c35d5e 100644 --- a/commands.js +++ b/commands.js @@ -3,6 +3,13 @@ import "dotenv/config"; import { REST, Routes } from "discord.js"; const commands = [ + { + name: "blep", + description: "blep", + type: 1, + integration_types: [0], + contexts: [0], + }, { name: "help", description: "get help", -- cgit v1.2.3