Public
Like
2
Discord-to-Linear
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v3View latest version
This automation creates Linear tickets from Discord messages when they receive a specific emoji reaction (🧿 :charmaine:).
Set these in your Val Town environment:
DISCORD_BOT_TOKEN
- Your Discord bot tokenLINEAR_API_KEY
- Your Linear API keyLINEAR_TEAM_ID
- The Linear team ID where tickets should be createdDISCORD_WEBHOOK_SECRET
- Secret for verifying Discord webhooks (optional but recommended)
- Go to https://discord.com/developers/applications
- Create a new application and bot
- Copy the bot token to
DISCORD_BOT_TOKEN
- Enable these bot permissions:
- Read Message History
- Add Reactions
- Use Slash Commands
- Add the bot to your Discord server
- In your Discord server settings, go to Integrations > Webhooks
- Create a new webhook pointing to:
https://[your-val-name].web.val.run/discord-webhook
- Configure it to listen for "Message Reactions" events
- Go to Linear Settings > API
- Create a new Personal API key
- Copy it to
LINEAR_API_KEY
- Find your team ID in Linear's URL or via API and set
LINEAR_TEAM_ID
Edit /backend/config.ts
to change the target emoji if needed (default is 🧿).
- User reacts to a Discord message with the configured emoji (🧿)
- Discord sends a webhook to our service
- Service fetches the full message content
- Creates a Linear ticket with:
- Title: First 100 characters of the message
- Description: Full message content + link to Discord message
- Labels: "discord-import"
/backend/index.ts
- Main HTTP handler and webhook endpoint/backend/discord.ts
- Discord API integration/backend/linear.ts
- Linear API integration/backend/config.ts
- Configuration and constants/backend/types.ts
- TypeScript type definitions