Skip to content

Commit 244793b

Browse files
committed
feat: native slash commands, full aiohttp migration, and persistence fixes
1 parent 80bea2c commit 244793b

3 files changed

Lines changed: 165 additions & 78 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ push_to_webserver.sh
1616
# Data and configurations
1717
config/
1818
routes.json
19+
test.txt
1920

2021
# Logs
2122
*.log

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ chmod +x start.sh
7979
> Because this bot reads chat commands (`!weather`), you **must** enable the **Message Content Intent**.
8080
> Go to the [Discord Developer Portal](https://discord.com/developers/applications) -> Your Bot -> **Bot** tab -> Scroll down to **Privileged Gateway Intents** -> Turn ON **Message Content Intent**.
8181
82-
### 🌐 Running on Alternative Ports (Local Overrides)
82+
### 🐳 Docker Overrides (Custom API Ports & Local IPs)
8383
If port `8080` is already in use on your host machine, or you need to mount local development variables without modifying tracked Git files, you can use a `docker-compose.override.yml` file.
8484

8585
Create a file named `docker-compose.override.yml` in the root directory:
@@ -92,9 +92,12 @@ services:
9292
volumes:
9393
- ./secrets.env:/app/secrets.env
9494
extra_hosts:
95-
- "n8n.local:192.168.1.102" # Map internal local LAN domains
95+
- "n8n.lan:192.168.1.102" # Map internal local LAN domains
9696
```
97-
97+
98+
> **💡 Missing Slash Commands?**
99+
> Discord aggressively caches Slash Commands on desktop and mobile clients. If you start the bot and don't immediately see your `/commands` in Discord, completely restart your Discord app (CTRL+R on desktop) to clear the cache.
100+
98101
---
99102

100103
## ⚙️ Configuration File (`routes.json`)
@@ -131,6 +134,24 @@ Commands map a typed Discord message to a webhook URL.
131134
* **Supported Methods:** Both `"POST"` and `"GET"` are supported.
132135
* **GET Requests:** If you choose `GET`, the entire JSON payload is stringified and passed as a URL query parameter (e.g., `?payload={"source":"discord", ...}`).
133136

137+
### ⌨️ Automatic Slash Commands
138+
139+
Whenever you add a new command to `routes.json`, DashCord will automatically register it as a native Discord Slash Command (e.g., `/ping`).
140+
141+
Users can trigger it by typing the traditional prefix (`!ping restart`) OR by using the Discord slash menu (`/ping arguments: restart`).
142+
- **Permissions:** The bot respects your `allowed_users` and `allowed_channels` rules even when triggered via Slash Commands.
143+
- **Descriptions:** You can add a `"description"` key to your command config to customize what shows up in the Discord Slash Command menu!
144+
145+
```json
146+
"commands": {
147+
"deploy": {
148+
"endpoint": "https://your-automation-tool.com/webhook/deploy",
149+
"description": "Trigger a server deployment pipeline",
150+
"allowed_users": ["1234567890"]
151+
}
152+
}
153+
```
154+
134155
### 2. Defining File Uploads
135156

136157
You can allow commands to accept attachments, or even fire automatically when a specific filetype is uploaded without a command at all.

0 commit comments

Comments
 (0)