-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
register.sh
18 lines (15 loc) · 827 Bytes
/
register.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
DISCORD_BOT_TOKEN="${DISCORD_BOT_TOKEN:-0000000000000000000000000000000000000}"
DISCORD_APPLICATION_ID="${DISCORD_APPLICATION_ID:-0000000000000000}"
# /ping command
curl -X POST \
-H 'Content-Type: application/json' \
-H "Authorization: Bot $DISCORD_BOT_TOKEN" \
-d '{"name":"ping","description":"ping a bot","options":[]}' \
"https://discord.com/api/v8/applications/$DISCORD_APPLICATION_ID/commands"
# /query command
curl -X POST \
-H 'Content-Type: application/json' \
-H "Authorization: Bot $DISCORD_BOT_TOKEN" \
-d '{"name":"query","description":"Run a chdb SQL query","options":[{"name":"query","description":"SQL query","type":3,"required":true},{"name":"format","description":"Query output format","type":3,"required":false}]}' \
"https://discord.com/api/v8/applications/$DISCORD_APPLICATION_ID/commands"