✔️ Ready-made bot functions:
- A system of suggestions and messages from users, this is suitable if you are the administrator of a telegram channel;
- The button to show the main command menu is always located in the lower keyboard for user convenience
- List of social networks;
- Other custom commands, such as
playlist,aboutorchannel
You can easily customize the responses from the bot by changing the text in the files in the messages directory
The same goes for commands, you can edit them by changing files in the commands directory
If you want to deploy your bot remotely using third-party services, use the bot template from the for_deployment branch
- TypeScript - For enhanced code quality and maintainability
- Node.js - JavaScript runtime environment
- Telegraf - Node.js Telegram Bot API framework
- ts-node - TypeScript execution and REPL for node.js.
- dotenv - Environment variable management
To run your bot locally with telegram-bot-template, follow these steps:
- Clone the repository:
git clone https://github.com/mi1sh/telegram-bot-template.git- Navigate to the project directory:
cd telegram-bot-template-
Install dependencies:
Using
npm:npm install
Using
yarn:yarn install
-
Go to BotFather, create new bot and copy your bot token.
-
After that, go to getMyID_bot (for example) and get your Telegram User ID.
-
Create an
.envfile in the root of your project or use the ready-made.env.exampletemplate. The file must contain theBOT_TOKENandCHAT_IDvariables. Paste your token and id into variables:
BOT_TOKEN=your_bot_token
CHAT_ID=your_telegram_id-
Run your bot locally:
Using
npm:npm run start
Using
yarn:yarn start
🟢 That's it! You will see the message Bot is running in the console if everything went well.
Contributions to telegram-bot-template are welcome. If you have a feature request or bug report, please open an issue on the GitHub repository. If you'd like to contribute code, please submit a pull request.
telegram-bot-template is open-source software licensed under the MIT License. See the LICENSE file for more details.
