No description
- Go 98.6%
- Dockerfile 1.4%
| .claude | ||
| data | ||
| .editorconfig | ||
| .gitignore | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE.md | ||
| main.go | ||
| README.md | ||
Discord-Planka Integration Bot
A Discord bot that syncs Discord forum threads with Planka kanban boards. Each Discord thread becomes a Planka card with bidirectional synchronization.
Features
- Bidirectional Sync: Changes in Discord sync to Planka and vice versa
- Thread → Card: Discord forum threads automatically create Planka cards
- Comments: Thread replies become Planka comments
- Attachments: File uploads sync between platforms
- Status Tracking: Card list changes update Discord threads
- Auto-archive: Completed cards automatically archive Discord threads
Requirements
- Go 1.20+
- Planka instance with API access
- Discord bot with appropriate permissions
- SQLite (included with go-sqlite3)
Installation
- Clone this repository
- Install dependencies:
go mod download
- Create a
.envfile with your configuration (see Configuration section) - Create the data directory:
mkdir data
- Build and run:
go build
./taiga-discord
Configuration
Environment Variables (.env)
| Variable | Description | Example |
|---|---|---|
DISCORD_TOKEN |
Discord Bot Token | your_discord_bot_token |
PLANKA_URL |
Planka Base URL | https://planka.example.com |
PLANKA_USERNAME |
Planka Bot Account Username/Email | bot@example.com |
PLANKA_PASSWORD |
Planka Bot Account Password | secure_password |
PLANKA_BOARDS |
Comma-separated list of Planka Board IDs | 1234567890123456,9876543210987654 |
[BOARD_ID]_CHANNEL_ID |
Discord Forum Channel ID for each Board | 1234567890123456_CHANNEL_ID=987654321098765432 |
[BOARD_ID]_BACKLOG |
Planka List ID for Backlog status | 1234567890123456_BACKLOG=1357924680246802 |
[BOARD_ID]_IN_PROGRESS |
Planka List ID for In Progress status | 1234567890123456_IN_PROGRESS=2468135791357913 |
[BOARD_ID]_COMPLETED |
Planka List ID for Completed status | 1234567890123456_COMPLETED=3691482570246802 |
Example .env File
DISCORD_TOKEN=token
PLANKA_URL=https://planka.example.com
PLANKA_USERNAME=bot@example.com
PLANKA_PASSWORD=MySecurePassword123!
# Board 1
PLANKA_BOARDS=1357158568008091264
1357158568008091264_CHANNEL_ID=987654321098765432
1357158568008091264_BACKLOG=1357158568008091265
1357158568008091264_IN_PROGRESS=1357158568008091266
1357158568008091264_COMPLETED=1357158568008091267
Getting Planka IDs
To find the IDs needed for configuration:
- Board ID: Navigate to your board in Planka, the URL will be
/boards/{BOARD_ID} - List IDs: Open your browser's developer tools (F12), go to the Network tab, and observe API calls when viewing a board. Look for calls to
/api/boards/{BOARD_ID}- the response will include all list IDs.
Example API response:
{
"item": {
"id": "1357158568008091264"
},
"included": {
"lists": [
{"id": "1357158568008091265", "name": "To Do", "type": "active"},
{"id": "1357158568008091266", "name": "In Progress", "type": "active"},
{"id": "1357158568008091267", "name": "Done", "type": "closed"}
]
}
}
Discord Bot Setup
- Create a bot at Discord Developer Portal
- Enable these Privileged Gateway Intents:
- Message Content Intent
- Generate and save your bot token
- Invite the bot to your server with these permissions:
- Read Messages/View Channels
- Send Messages
- Manage Threads
- Read Message History
- Attach Files
How It Works
Discord → Planka
- New Thread: Creates a new card in the Backlog list
- Thread Name Change: Updates card name
- First Message Edit: Updates card description
- Reply: Creates a comment on the card
- Reply Edit: Updates the comment
- File Upload: Creates an attachment on the card
Planka → Discord
- Card List Change: Posts status update message in thread
- Card → Completed List: Archives the Discord thread
Database Schema
The bot uses SQLite with three tables:
tasks
id: Primary keythread_id: Discord thread IDmessage_id: Discord message IDplanka_card_id: Planka card IDplanka_list_id: Current Planka list IDplanka_board_id: Planka board ID- Legacy fields:
task_id,status_id(for migration compatibility)
comments
id: Primary keymessage_id: Discord message IDcomment_id: Planka comment IDplanka_card_id: Planka card IDupdated_at: Timestamp- Legacy field:
task_id(for migration compatibility)
uploads
id: Primary keymessage_id: Discord message IDfile_id: Discord attachment IDplanka_file_id: Planka attachment IDplanka_card_id: Planka card IDfile_url: Attachment URL- Legacy fields:
task_id,taiga_file_id(for migration compatibility)
Development
Project Structure
main.go: Main application with Planka integrationmigration.json.example: Example migration configurationdata/: SQLite database directory.env: Environment configuration (not in git)
Building
go build -o planka-discord
Running in Development
go run main.go
Troubleshooting
Bot not responding
- Check that the bot has proper permissions in Discord
- Verify
DISCORD_TOKENis correct - Ensure the forum channel ID matches configuration
Cards not syncing
- Verify Planka credentials are correct
- Check that board and list IDs are valid
- Review Planka user has proper permissions
Database errors
- Ensure
data/directory exists - Check file permissions on
data/tasks.db - Verify SQLite is working:
sqlite3 data/tasks.db ".tables"
API Documentation
This project uses:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions welcome! Please open an issue or submit a pull request.
Changelog
v2.0.0 - Planka Migration
- Complete rewrite to use Planka instead of Taiga
- Simplified authentication (no refresh tokens needed)
- Improved error handling
- Added migration tool for Taiga users
- Updated database schema with Planka fields
- Maintained backward compatibility for smooth migration
v1.0.0 - Initial Taiga Version
- Discord forum thread integration
- Taiga user stories synchronization
- Bidirectional sync
- File attachment support
- Comment synchronization