A simple Telegram chatbot built with Node.js and the Telegram Bot API
This Telegram chatbot is designed to [mention the purpose of your chatbot]. It uses the Telegram Bot API to interact with users on the Telegram platform.
- Commands: Interact with the bot using various commands.
- Images Upload: Allow users to upload images to the bot.
- Documents Read Upload: Accept document uploads for further processing.
-
Clone the repository and cd:
git clone https://github.com/avinashtare/Telegram-Chat-Bot.git cd Telegram-Chat-Bot
-
Open Telegram Channel [@BotFather]: -
-
Write Command:
/newbot
-
Copy Token And Rename .env.example to .env and set:
PORT=5012 Telegram_Bot_Token=<YOUR TOKEN> # Enter your ngrok public serve url <example> replace from you server url NgrokURL = "https://cc62-103-71-16-137.ngrok-free.app/"
- Install Ngrok For Window:
choco install ngrok
// you can also install direct as exe
- Configuration Your Ngrok:
ngrok config add-authtoken <AUTH_ID>
- Start a tunnel (Add You Telegram Chat Bot Running App PORT):
ngrok http 5012
- Configuration Your Chat Bot To You Host:
https://api.telegram.org/bot<Token>/setWebhook?url=<Ngrok_Url>
- Install Npm Pacakges:
npm i
- Start npm (before start do local configuration)
npm start
command | Responses |
---|---|
/Start | Hey hi! i am you bot! |
/random | Random Value |
/time | Current Time |
/by | Goood Byyyyy |
/uplaod image | return path |
you can change this in \controller\lib\Telegram.js
This project is released under the MIT License.
卐🕉 Avinash Tare 🕉 卐