A Node.js-based bot for handling chat commands and providing news updates.
- Responds to chat commands such as
*ping
,*help
,*categories
, and*news
. - Fetches and displays news based on user input.
- Built with TypeScript for type safety and scalability.
-
Clone the repository:
git clone <repository-url> cd mezon-bot-news
-
Install dependencies:
npm install
-
Set up environment variables:
- Copy
.env.example
to.env
and configure the required values.
- Copy
-
Development Mode:
npm run start:dev
-
Production Mode:
npm run start
The bot supports the following commands:
*ping
: Check if the bot is online.*help
: Get a list of available commands.*categories
: List available news categories.*news <source>
: Fetch news from a specific source.
src/
├── app.ts # Application entry point
├── container.ts # Dependency injection container
├── index.ts # Main file
├── server.ts # Server setup
├── configs/ # Configuration files
├── constants/ # Constants (e.g., chat commands, error messages)
├── entities/ # Database entities
├── errors/ # Custom error classes
├── helpers/ # Utility functions
├── interfaces/ # TypeScript interfaces
├── middlewares/ # Express middlewares
├── models/ # Data models
├── services/ # Business logic
├── types/ # Type definitions
-
Unit Tests:
npm run test
-
End-to-End Tests:
npm run test:e2e
-
Test Coverage:
npm run test:cov
This project is licensed under the MIT License.