• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
redlicdev

redlicdev

DiscordBotBoilerplate

Public
Like
DiscordBotBoilerplate
Home
Code
3
README.md
H
index.ts
main.ts
Branches
1
Pull requests
Remixes
History
Environment variables
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
/
Code
/
Search
index.ts
https://redlicdev--574143f490a711f0bbf30224a6c84d84.web.val.run
README.md

Discord Bot Boilerplate

A Discord bot using HTTP interactions (webhooks) instead of the Gateway API.

Features

  • HTTP-based Discord interactions using webhooks
  • Hono.js web framework
  • discord-interactions middleware for signature verification
  • Simple /ping slash command

Setup

  1. Create a Discord application at https://discord.com/developers/applications
  2. Get your application's public key and bot token
  3. Set environment variables:
    • DISCORD_PUBLIC_KEY: Your application's public key
    • DISCORD_BOT_TOKEN: Your bot token
  4. Register the slash commands (run the registration endpoint once)
  5. Set your Discord application's Interactions Endpoint URL to your Val Town HTTP endpoint

Environment Variables

  • DISCORD_PUBLIC_KEY: Required for verifying Discord requests
  • DISCORD_BOT_TOKEN: Required for registering slash commands

Endpoints

  • POST / - Main Discord interactions endpoint
  • POST /register-commands - Register slash commands with Discord (run once)

Commands

  • /ping - Simple ping command that responds with "Pong!"
HTTP
  • index.ts
    redlicdev--57…84.web.val.run
Code
README.md
H
index.ts
main.ts
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.