Discord bot for Dictionarry that bridges Discord and GitHub for issue tracking and community support.
- Two-way GitHub sync - Forum threads sync with GitHub issues, comments flow both directions
- Support request workflow - Multi-step modal flow for creating issues across repos
- Multi-repo support - Handles profilarr, database, and website repositories
- Webhook handling - GitHub signature verification, changelog notifications, rebuild status
- Dual command systems - Both slash commands (
/support) and prefix commands (!help)
- Discord.js v14 - Bot framework
- Hono - HTTP server for webhooks
- TypeScript - Type-safe development
- SQLite - Local database for sync records
src/
├── carrier/ # Discord <-> GitHub sync module
├── commands/ # Slash commands (/support, /wizard, etc.)
├── events/ # Discord event listeners
├── prefix/ # Prefix commands (!help, !docs, etc.)
├── webhooks/ # GitHub webhook handlers
├── utils/ # Logger, helpers
├── index.ts # Bot entry point
└── server.ts # HTTP server for webhooks
- Node.js 20+
- npm
npm install
cp .env.example .env| Variable | Description |
|---|---|
DISCORD_TEST_BOT_TOKEN |
Test bot token (development) |
DISCORD_BOT_TOKEN |
Production bot token |
GITHUB_TOKEN |
GitHub personal access token |
GITHUB_WEBHOOK_SECRET |
Secret for webhook signature verification |
CARRIER_FORUM_CHANNEL |
Production forum channel ID |
CARRIER_FORUM_CHANNEL_DEV |
Development forum channel ID |
CARRIER_ORG |
GitHub organization (default: Dictionarry-Hub) |
CHANGELOG |
Channel ID for changelog notifications |
REBUILD |
Channel ID for rebuild status notifications |
PORT |
HTTP server port (default: 3000) |
npm run dev # Start with test bot tokenFor webhook testing locally, use ngrok or similar to expose the server:
ngrok http 3000npm run build# Install PM2 globally
npm install -g pm2
# Start the bot
pm2 start dist/index.js --name parrot
# Useful PM2 commands
pm2 logs parrot # View logs
pm2 restart parrot # Restart
pm2 stop parrot # Stop
pm2 delete parrot # Remove from PM2
# Auto-start on system reboot
pm2 startup
pm2 save| Command | Description |
|---|---|
/support |
Create a support request (syncs to GitHub) |
/wizard |
Link to the Dictionarry profile wizard |
/profile |
Profile-related commands |
/format |
Format-related commands |
/ping |
Check bot latency |
All prefix commands use ! as the prefix.
| Command | Description |
|---|---|
!help |
List available commands |
!support |
Support request info |
!docs |
Documentation links |
!github |
GitHub links |
!beta |
Beta program info |
!donate |
Donation info |
!setup |
Setup guide |
!sync |
Sync info |
!upgrades |
Upgrade info |
!language |
Language info |
!quality |
Quality info |
!propers |
Propers info |
!anime |
Anime info |
!coc |
Code of Conduct |
!dv |
Dolby Vision & HDR explanation |
!trick |
Ask the parrot to do a trick |
Create a file in src/commands/:
// src/commands/example.ts
import { SlashCommandBuilder } from "discord.js";
import { Command } from "../types";
export const command: Command = {
data: new SlashCommandBuilder()
.setName("example")
.setDescription("Example command"),
execute: async (interaction) => {
await interaction.reply("Hello!");
},
};Register in src/commands/index.ts.
Create a file in src/prefix/:
// src/prefix/example.ts
import { PrefixCommand } from "./registry";
export const command: PrefixCommand = {
name: "example",
description: "Example prefix command",
execute: async (message) => {
await message.reply("Hello!");
},
};Register in src/prefix/index.ts.
Create a file in src/events/:
// src/events/example.ts
import { Event } from "../types";
export const event: Event<"messageCreate"> = {
name: "messageCreate",
once: false,
execute: async (message) => {
// Handle message
},
};Register in src/events/index.ts.
The Carrier module handles bidirectional sync between Discord forum threads and GitHub issues.
- User runs
/supportand fills out the modal - Bot creates a forum thread and GitHub issue
- Messages in the thread sync to GitHub comments
- GitHub comments sync back to Discord
- Archiving a thread closes the issue (and vice versa)
profilarr- Main applicationdatabase- Database/profileswebsite- Documentation site
The bot runs an HTTP server (default port 3000) that handles:
| Endpoint | Purpose |
|---|---|
/webhook |
General webhooks (changelog, rebuild) |
/webhook/github |
GitHub webhooks (issue comments, state changes) |
Configure GitHub webhooks to point to https://your-domain/webhook/github with the secret matching GITHUB_WEBHOOK_SECRET.
Logs are written to the /logs directory with daily rotation. Console output includes colored formatting for different log levels.