FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
project logo

charmaine

Discord-to-Linear

Discord -> Linear ticket based on emoji reaction trigger
Public
Like
2
Discord-to-Linear
Home
Code
1
README.md
Branches
1
Pull requests
Remixes
3
History
Environment variables
5
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.
Sign up now
Code
/
README.md
Code
/
README.md
Search
5/24/2025
Viewing readonly version of main branch: v1
View latest version
README.md

Discord to Linear Ticket Automation

This automation creates Linear tickets from Discord messages when they receive a specific emoji reaction (🧿 :charmaine:).

Setup Instructions

1. Environment Variables

Set these in your Val Town environment:

  • DISCORD_BOT_TOKEN - Your Discord bot token
  • LINEAR_API_KEY - Your Linear API key
  • LINEAR_TEAM_ID - The Linear team ID where tickets should be created
  • DISCORD_WEBHOOK_SECRET - Secret for verifying Discord webhooks (optional but recommended)

2. Discord Bot Setup

  1. Go to https://discord.com/developers/applications
  2. Create a new application and bot
  3. Copy the bot token to DISCORD_BOT_TOKEN
  4. Enable these bot permissions:
    • Read Message History
    • Add Reactions
    • Use Slash Commands
  5. Add the bot to your Discord server

3. Discord Webhook Setup

  1. In your Discord server settings, go to Integrations > Webhooks
  2. Create a new webhook pointing to: https://[your-val-name].web.val.run/discord-webhook
  3. Configure it to listen for "Message Reactions" events

4. Linear API Setup

  1. Go to Linear Settings > API
  2. Create a new Personal API key
  3. Copy it to LINEAR_API_KEY
  4. Find your team ID in Linear's URL or via API and set LINEAR_TEAM_ID

5. Configure the Reaction Emoji

Edit /backend/config.ts to change the target emoji if needed (default is 🧿).

How It Works

  1. User reacts to a Discord message with the configured emoji (🧿)
  2. Discord sends a webhook to our service
  3. Service fetches the full message content
  4. Creates a Linear ticket with:
    • Title: First 100 characters of the message
    • Description: Full message content + link to Discord message
    • Labels: "discord-import"

Files

  • /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
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.