aboutsummaryrefslogtreecommitdiff
path: root/commands.js
diff options
context:
space:
mode:
authorJacob Janzen <jacob@jjanzen.ca>2024-12-08 01:56:35 +0000
committerJacob Janzen <jacob@jjanzen.ca>2024-12-08 01:56:35 +0000
commit0fbf84b271709582fb328941382f563d15e129eb (patch)
treee6b142684e092b54dd036f04a714b3944270c00e /commands.js
initial commit
Diffstat (limited to 'commands.js')
-rw-r--r--commands.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/commands.js b/commands.js
new file mode 100644
index 0000000..7df2f8c
--- /dev/null
+++ b/commands.js
@@ -0,0 +1,35 @@
+import 'dotenv/config';
+import {InstallGlobalCommands} from './utils.js';
+
+const SCHEDULE_MESSAGE = {
+ name: 'schedule_message',
+ description: 'Register a message to be sent at a specific time',
+ type: 1,
+ options: [
+ {
+ type: 3,
+ name: 'message',
+ description: 'the message to send',
+ required: true,
+ },
+ {
+ type: 3,
+ name: 'crontab_string',
+ description: 'the time the message should be sent at in crontab format',
+ required: true,
+ },
+ {
+ type: 4,
+ name: 'repeat',
+ description: 'how many times should the message be repeated? (0 is infinite and the default)',
+ required: false,
+ min_value: 0,
+ },
+ ],
+ integration_types: [0, 1],
+ contexts: [0, 1, 2],
+};
+
+const ALL_COMMANDS = [SCHEDULE_MESSAGE];
+
+InstallGlobalCommands(process.env.APP_ID, ALL_COMMANDS);