A Discord bot for the Meshtastic community that streamlines bug reporting and feature requests by creating GitHub issues directly from Discord through interactive modals. Designed to be a friendly customer service helper for users seeking assistance. Built with Go for performance and reliability.
- Interactive Bug Reports: Submit bug reports directly to GitHub through Discord modals
- Feature Requests: Create feature requests with rich formatting
- FAQ System: Searchable FAQ with autocomplete for quick answers
- Health Check Endpoint: Built-in HTTP server for monitoring and container health checks
/tapsign: Display a short help message in the channel/faq <topic>: Search and display frequently asked questions (with autocomplete)/bug <title>: Submit a bug report (opens an interactive modal)/feature <title>: Request a new feature (opens an interactive modal)
This bot uses environment files to manage configuration and secrets for different environments.
Recommendation: Create both .env.dev and .env.prod files with different Discord servers:
- Development (
.env.dev): Use a personal Discord server for testing bot changes and updates without affecting your production users - Production (
.env.prod): Use your main Discord server where real users interact with the bot
Use this file when developing or testing the bot locally. Development mode:
- Provides verbose logging for debugging
- Registers slash commands instantly to your test server (no global propagation delay)
- Should point to a personal/test Discord server (use a different
DISCORD_SERVER_ID&DISCORD_TOKEN) - Runs using Docker via the included
run.shscript
Use this file when deploying the bot to your production Discord server. Production mode:
- Uses optimized logging
- Registers commands globally (may take up to 1 hour to propagate)
- Points to your main production Discord server
- Runs using Docker via the included
run.shscript
Both modes use the same Docker setup - the only difference is which environment file you pass to run.sh. More details about using the run.sh file are covered in the Deployment section
Before running the bot, you need to create a Discord application and configure it properly.
- Go to the Discord Developer Portal
- Click "New Application"
- Give your application a name and click "Create"
- In your application's settings, navigate to the "Bot" tab
- On the username field give this bot a name of "Meshtastic Bot"
- Upload the Meshtastic icon as the avatar
- On the "Bot" tab, click "Reset Token" to reveal the bot's token
- Important: Treat this token like a password. Never share it or commit it to version control
- Copy this token for your environment file (
.env.devor.env.prod)
On the "Bot" tab, scroll down to "Privileged Gateway Intents" and enable:
- Message Content Intent (required for reading messages)
- Navigate to "OAuth2" → "URL Generator"
- In "Scopes", select:
botapplications.commands
- In "Bot Permissions", select:
Send MessagesUse Slash CommandsEmbed Links
- Copy the below generated URL from the URL Generator
- Paste it into your browser
- Select your server (requires "Manage Server" permission)
- Authorize the bot
- Enable Developer Mode in Discord: User Settings → Advanced (has an icon with three dots) → Toggle Developer Mode
- Right-click your server icon → "Copy Server ID"
- Copy this for your environment file (
.env.devor.env.prod)
The bot needs a GitHub personal access token to create issues on your behalf.
- Go to GitHub Settings → Developer settings → Personal access tokens → Fine-grained tokens
- Click "Generate new token"
- Give your token a descriptive name (e.g., "Meshtastic Discord Bot Prod")
- Set an expiration date (recommended: 90 days or custom)
- Under "Repository access", select either:
- Only select repositories (recommended): Choose the specific repositories where the bot should create issues
- All repositories: If you want the bot to have access to all your repositories
Under "Permissions" → "Repository permissions":
- Find Issues in the list
- Set the access level to Read and write
- This is the only permission required for the bot to function
- Click "Generate token" at the bottom of the page
- Important: Copy the token immediately - you won't be able to see it again
- Treat this token like a password. Never share it or commit it to version control
- Copy this token for your environment file (
.env.devor.env.prod)
- Docker installed
- Discord bot token (see Discord Bot Setup above)
- GitHub personal access token (see GitHub Personal Access Token Setup above)
-
Clone the repository:
git clone https://github.com/meshtastic/meshtastic-bot.git cd meshtastic-bot -
Create your development environment file:
cp .env.example .env.dev
-
Edit
.env.devwith your development credentials:DISCORD_TOKEN=your_discord_bot_token GITHUB_TOKEN=your_github_personal_access_token DISCORD_SERVER_ID=your_server_id CONFIG_PATH=config.yaml FAQ_PATH=faq.yaml HEALTHCHECK_PORT=8081 # Different from production (8080) to avoid port conflicts ENV=dev
-
Run the bot using Docker:
./run.sh .env.dev
The bot will start in development mode with verbose logging. Slash commands will register instantly to your test server.
# Run all tests
go test ./...
# Run with verbose output
go test ./... -v
# Run specific package
go test ./config
go test ./discord/handlers
# Run specific test
go test ./config -run TestParseTemplateURL# Run with coverage
go tool cover -html=coverage.out
# Run with race detection
go test ./... -race
# Run tests in parallel
go test ./... -parallel 4Defines command-to-GitHub-repository mappings:
config:
- command: bug
template_url: https://github.com/meshtastic/web/blob/main/.github/ISSUE_TEMPLATE/bug.yml
channel_id:
- '123456789'
title: Bug Report
- command: feature
template_url: https://github.com/meshtastic/web/blob/main/.github/ISSUE_TEMPLATE/feature.yml
channel_id:
- '123456789'
title: Feature RequestDefines FAQ items and software modules:
faq:
- name: Getting Started
url: https://meshtastic.org/docs/getting-started
- name: Supported Devices
url: https://meshtastic.org/docs/hardware
software_modules:
- name: Arduino
url: https://meshtastic.org/docs/software/arduino
- name: Python SDK
url: https://meshtastic.org/docs/software/python- Docker installed on your server
- Discord bot token and GitHub token (see setup sections above)
-
Create production environment file:
cp .env.example .env.prod
-
Edit
.env.prodwith your production credentials:DISCORD_TOKEN=your_discord_bot_token GITHUB_TOKEN=your_github_personal_access_token DISCORD_SERVER_ID=your_server_id CONFIG_PATH=config.yaml FAQ_PATH=faq.yaml HEALTHCHECK_PORT=8080 ENV=prod
-
Deploy the bot:
./run.sh .env.prod
The
run.shscript uses your local Docker instance to build and run the bot, creating a new container taggedmeshtastic-bot.
The bot will start in production mode. Slash commands will register globally (may take up to 1 hour to propagate).
# View logs
docker logs -f meshtastic-bot
# Restart the bot
docker restart meshtastic-bot
# Update and redeploy
git pull
./run.sh .env.prod
# Check health
curl http://localhost:8080/healthThe project uses GitHub Actions for continuous integration.
Workflow: .github/workflows/ci.yml and .github/workflows/pr.yml
On Pull Requests & Pushes:
- Unit tests
- Build verification
- Docker image build
On Main Branch Push:
- All CI checks (after all checks pass)
- Docker image validation
meshtastic-bot/
├── cmd/
│ └── meshtastic-bot/
│ └── main.go # Application entry point
├── internal/ # Internal packages
│ ├── config/ # Configuration loading and validation
│ │ ├── config.go # Main config and URL parsing
│ │ ├── env.go # Environment variable handling
│ │ ├── faq.go # FAQ data structures
│ │ └── modal.go # Modal configuration
│ ├── discord/ # Discord bot implementation
│ │ ├── bot.go # Bot initialization
│ │ ├── commands.go # Slash command definitions
│ │ ├── handlers.go # Command handlers
│ │ └── handlers/ # Individual handler implementations
│ ├── github/ # GitHub API client
│ │ └── client.go
│ └── routes/ # HTTP routes and health checks
│ └── routes.go
├── .github/ # CI/CD workflows
│ └── workflows/
│ ├── ci.yml # Main CI/CD pipeline
│ └── pr.yml # Pull request checks
├── config.yaml # Command configuration
├── faq.yaml # FAQ content
├── run.sh # Docker runner script
└── Dockerfile # Multi-stage Docker build
| Variable | Required | Default | Description |
|---|---|---|---|
DISCORD_TOKEN |
Yes | - | Discord bot token |
DISCORD_SERVER_ID |
Yes | - | Target Discord server ID |
GITHUB_TOKEN |
Yes | - | GitHub personal access token |
CONFIG_PATH |
No | config.yaml |
Path to config.yaml |
FAQ_PATH |
No | faq.yaml |
Path to FAQ YAML file |
HEALTHCHECK_PORT |
No | 8080 |
HTTP health check port |
ENV |
No | dev |
Environment (dev/prod) |
The bot includes a built-in HTTP server for health monitoring:
# Check if bot is running
curl http://localhost:8080/health
# Response: {"status":"ok"}This endpoint is used by:
- Docker health checks
- Container orchestration monitoring
- Load balancers and reverse proxies
Contributions are welcome! Please follow these guidelines:
git clone https://github.com/meshtastic/meshtastic-bot.git
cd meshtastic-botgit checkout -b feature/your-feature-name (ci, fix, chore, feat, breaking, refactor)This project follows standard Go conventions. Use the built-in Go tools:
# Format code
go fmt ./...
# Static analysis
go vet ./...- Add tests for new functionality
- Ensure all tests pass:
go test ./... - Maintain or improve test coverage
- Write clear, descriptive commit messages
- Follow conventional commits format
- Keep commits focused and atomic
- Push your branch to your fork
- Open a pull request against
main - Describe your changes clearly
- Link any related issues
- Wait for CI checks to pass
- Address review feedback
After deploying slash commands, they may take up to an hour to propagate globally in production mode. For faster testing:
- Use development mode (
.env.dev) for instant command registration to your test server - Test in your development server first before deploying to production
- Check bot has required permissions in Discord server
- Verify
DISCORD_SERVER_IDis correct - Ensure slash commands are registered (check bot logs)
- Confirm bot has "Use Slash Commands" permission
- Ensure your bot shows in the member list, and shows as online in your Discord channel
- Verify
GITHUB_TOKENhas either access toall public reposorselected repos - Ensure
GITHUB_TOKENhas pelmissions with read/write access toissues - Check template URLs in
config.yamlare valid, verify the url by pasting it into your web browser. - Ensure bot has read/write access in the github token to target repository
- Check logs for specific error messages
- Ensure Go 1.25+ is specified in Dockerfile
- Verify all dependencies are in
go.mod, try runninggo mod tidyto ensure all dependencies are downloaded. - Check for syntax errors:
go build .
See LICENSE.md in this repo for more details.
- Documentation: Meshtastic Docs
- Discord: Meshtastic Discord
- Issues: GitHub Issues