This repository contains an example of a Mezon bot built using NestJS.
This project demonstrates how to create a chatbot using NestJS as the backend framework for the Mezon bot. It provides a starting point for developers looking to build their own conversational applications.
- Visit the Mezon Developer Portal
- Sign in with your Mezon account or create one
- Click on "New Application" to create a new bot
- Fill in the required details for your bot:
- Name
- Description
- After creation, navigate to the "Bot" section to get your bot token
- Copy the bot token and bot ID to use in your
.env
file
Once you have your bot credentials, you can use them to connect your NestJS application to the Mezon platform. The example code in this repository demonstrates how to set up the connection and handle bot events.
- Node.js (v14+)
- npm or yarn
- NestJS CLI
# Clone the repository
git clone https://github.com/mezonai/mezon-bot-example-nestjs.git
# Navigate to the project directory
cd mezon-bot-example-nestjs
# Install dependencies
npm install
Create a .env
file in the root directory and add the following configuration:
# Bot configuration
MEZON_TOKEN=your_bot_token_here
BOT_ID=your_bot_id_here
# Other environment variables
PORT=3000
# Development mode
npm run start:dev
# Production mode
npm run start:prod
src/
├── bot/ # Bot-specific modules and services
├── main.ts # Application entry point
└── app.module.ts # Main application module
test/
- NestJS architecture with dependency injection
- Mezon bot framework integration
- Example conversation flows
- Middleware for message processing
- Ready for deployment
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.