Hosts Discord bot logic in a Next.js project, with command handling going through a REST API interaction endpoint
nextjs-discord-bot-boilerplate — Next.js Starter Template
By mmvergara
A Next.js-based Discord bot starter template that handles slash command registration and interactions via REST API, with deployment and invitation workflows included.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 2
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Includes built-in command template files, so new slash commands can be added by following the example structure
Provides a command registration entry point, triggered by a custom key in the environment variables
The README gives complete steps from filling in environment variables, deploying, configuring the interaction endpoint, to inviting the bot
Comes with an online demo site and a separate documentation site; the repository uses the MIT license
Template Details
This template wraps Discord bot slash command handling inside a Next.js project, interacting with Discord through REST API rather than a persistent gateway connection. The repository states its goal is to pre-build the abstractions for command construction, command registration, and deployment so users only need to focus on the logic of the commands themselves.
In terms of workflow, the template requires cloning the repository and filling in environment variables (application ID, public key, bot token, and a custom key used to register commands), which come from the application page in the Discord Developer Portal. When adding commands, refer to the example files in the commands directory and write according to the template structure. After deployment, enter the /api/discord-bot/interactions path under the deployment address into the Interactions Endpoint URL in the Discord Developer Portal, then submit the registration key through the deployed site to register commands, and finally invite the bot to a server from the invitation entry on the site.
The template provides an online demo and a separate documentation site, and the repository uses the MIT license. The README does not specify details such as command count limits, concurrency handling, error retries, or data persistence, so these need to be confirmed before use.
Is it right for your project?
Use Cases
- Want to write a Discord slash command bot with Next.js but do not want to build command registration and interaction handling from scratch
- Need to deploy the bot to a hosting platform such as Vercel and receive Discord interactions via an HTTP endpoint
- Use as a reference project for learning how to implement a Discord bot using REST API
Suitable For
- Developers familiar with Next.js and TypeScript
- Personal projects that need a quick start for a Discord slash command bot
- Scenarios where the bot is intended to run on serverless hosting
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
After cloning the repository, fill in four environment variables: NEXT_PUBLIC_APPLICATION_ID, PUBLIC_KEY, BOT_TOKEN, and REGISTER_COMMANDS_KEY
- 2
The environment variable values come from the Application page in the Discord Developer Portal
- 3
After deployment, enter /api/discord-bot/interactions into the Discord Interactions Endpoint URL
- 4
Submit REGISTER_COMMANDS_KEY on the deployed site to complete command registration, then invite the bot to a server from the site
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis entry covers the free version of the public repository under the MIT license; the free scope is the code of this version and does not mean external services or third-party assets are free.
Must comply with when using
- Free use, modification, commercial use, and distribution of this version's code are permitted.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Before use, you must have a Discord developer account and create an application in the Discord Developer Portal to obtain credentials such as the application ID, public key, and bot token; otherwise the bot cannot run.
- The template relies on an external hosting service for deployment (such as Vercel), and you must bear the hosting platform's terms and possible costs yourself; the README only states that free deployment is possible.
- Registering slash commands requires submitting the custom key REGISTER_COMMANDS_KEY through the deployed site; this key must be set by yourself and kept secure, otherwise command registration cannot be completed.
- Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
you can get these on your [**Discord > Developer > Application**](https://discord.com/developers/applications)
Original README
Since this is a nextjs project, you can deploy it to vercel for free
Original README
https://github.com/mmvergara/nextjs-discord-bot-boilerplate/blob/main/LICENSE.mdhttps://github.com/mmvergara/nextjs-discord-bot-boilerplate/blob/main/README.mdOpen your deployment website, fill and submit the `REGISTER_COMMANDS_KEY` you set earlier in the environment variables to register your commands.
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-03. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- Partly documented · 72 / 100
- Technologies
- Next.js · React
- Website type
- Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2024-09-05
- Screenshot last checked
- 2026-10-03
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Review declaration: [email protected] · 2026-10-04
Inspect the recorded source material
SHA-256: e9dbb38c15f9f0e83adda34e79336b6e3ac5c2ffb74b4c4c6c65f9021944408f
2026-10-03T13:47:03.313Z
Source file / repository# NextJS Discord Bot [**`🤖 Invite this Bot to your server`**](https://mmv-nextjs-discord-bot-boilerplate.vercel.app/) <br/> [**`📚 Documentation`**](https://mmv-docs.vercel.app/docs/nextjs-discord-bot-template/getting-started) <p align="center"><img src="/public/logo-new.svg" width="300"></p> Yes, free fully functional rest-api discord bot 🤖 can be made using nextjs 🤯 🚀 I have done all of the abstraction for you, so you can focus on building your bot 🛠️ - ✅ Easy Command Building - ✅ Easy Command Registration - ✅ Easy Deployment # Getting Started ### 1. Installation - Clone Repository - Fill out environment variables - you can get these on your [**Discord > Developer > Application**](https://discord.com/developers/applications) ```env NEXT_PUBLIC_APPLICATION_ID= PUBLIC_KEY= BOT_TOKEN= # Custom secret key to register your commands REGISTER_COMMANDS_KEY= ``` ### 2. Adding your own Slash Commands - Just go to `./commands/tutorialhere.ts` after cloning and you will see the template for creating a command - [In-Depth - Documentation](https://mmv-docs.vercel.app/docs/nextjs-discord-bot-boilerplate/adding-slash-commands) ### 3. Deploy - Since this is a nextjs project, you can deploy it to vercel for free ### 4. Add Interaction Endpoint After deploying you will have your url - goto https://discord.com/developers/applications - then scroll to into "INTERACTIONS ENDPOINT URL"  - Example > https://mmv-nextjs-discord-bot-boilerplate.vercel.app/api/discord-bot/interactions ### 5. Register Commands Open your deployment website, fill and submit the `REGISTER_COMMANDS_KEY` you set earlier in the environment variables to register your commands. _Alternative way of registering command in [Discord Documentation](https://discord.com/developers/docs/interactions/application-commands#endpoints)_ ### 6. Invite your discord bot - Open your deployment website and click "Invite Discord Bot" then your done! - the link has the necessary required permissions to run the bot
Explore similar templates
Compare previews and descriptions within the same stack and category.

Next.js SaaS Starter
The official Next.js SaaS starter template, integrating email/password authentication, Stripe Checkout subscriptions, a dashboard with user/team CRUD, basic Owner/Member RBAC, and activity logging.
Next.js · SaaS

Next.js Commerce
Vercel's officially maintained Next.js App Router ecommerce starter with deep Shopify integration, offering a complete product catalog, cart, and checkout flow. Core logic is modular for swapping backends, and community provider versions exist for BigCommerce, Medusa, and Saleor.
Next.js · E-commerce

Next-js-Boilerplate
A developer-first Next.js 16 starter with Tailwind CSS 4 and TypeScript, supporting both App Router and Page Router.
Next.js · Starter

tailwind-nextjs-starter-blog
A Next.js and Tailwind CSS blog starter template using Contentlayer for Markdown/MDX, with built-in SEO, code highlighting, and tags. It targets personal technical blogs and migration from Jekyll/Hugo to React, and supports one-click Vercel deployment.
Next.js · Blog

next-forge
next-forge is a Turborepo-based Next.js template maintained by Vercel, positioned as a starting point for SaaS products.
Next.js · Starter

SaaS-Boilerplate
SaaS-Boilerplate is an open-source SaaS starter template built with Next.js App Router, React 19, TypeScript, Tailwind CSS, and Shadcn UI.
Next.js · SaaS
