Skip to content

Latest commit

 

History

History
47 lines (34 loc) · 1.26 KB

README.md

File metadata and controls

47 lines (34 loc) · 1.26 KB

tele-go-m

telegram bot in go (using webhook)

Beginner's guide for telegram bot

How to make the best use of tele-go-m

We have added the basic backend code to run your bot, you can clone this repo and use it as you'r own

git clone https://github.com/Co-Science/tele-go-m.git
cd tele-go-m

But before you begin create a .env file to the root directory and add your bot api key for testing:

TOKEN=<add your_bot_token here>

Now run the code:

go run main.go
  • The program now listens on port 3000 for some request.

  • Make use of ngrok to test your bot locally.

ngrok http 3000
  • Now set your bots webhook to that url
https://api.telegram.org/bot<your_bot_token>/setWebhook?url=<your_https_url_ngrok_provides>

| this is essentially connecting your bot with the telegram server

Congratss Your bot is now ready to chat with you(locally). Just type telegom or any letter in it and see the bot reply.

Fork, Edit and Deploy it in heroku or with any cloud provider to use the bot.