This project is a template for creating a Telegram bot using TypeScript. It includes a variety of features and utilities to help you get started with bot development.
-
Internationalization (i18n): The bot supports multiple languages. Currently, English and French are supported. You can easily add more languages by adding new
.ftl
files in thelocales
directory. -
MongoDB Integration: The bot is configured to connect to a MongoDB database. This is used for storing user data and settings.
-
Inline Menus: The bot uses inline menus for user interaction. This makes it easy to navigate through the bot's features and settings.
-
Middleware: The bot uses middleware for handling updates and managing the bot's state.
-
Environment Variables: The bot uses environment variables for configuration. This makes it easy to configure the bot for different environments without changing the code.
-
Clone the repository: Clone this repository to your local machine.
-
Install dependencies: Run
npm install
to install the project dependencies. -
Configure environment variables: Copy the
.env.sample
file to a new file named.env
and fill in your bot token and MongoDB connection string. -
Start the bot: Run
npm start
to start the bot.
The main entry point of the bot is src/app.ts
. This file connects to the MongoDB database and starts the bot.
The bot's code is located in the src/bot
directory. This includes the bot's commands, menus, and middleware.
The src/bot/menu
directory contains the code for the bot's inline menus. The src/bot/middlewares
directory contains the bot's middleware.
The src/models
directory contains the MongoDB models used by the bot.
The locales
directory contains the .ftl
files used for internationalization.
Contributions are welcome! Please feel free to submit a pull request.
This project is licensed under the ISC License.