Skip to content

Simple telegram bot hosted on replit using flask, It forwards messages using the mailgun api

License

Notifications You must be signed in to change notification settings

h1n054ur/telegram2mailbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

h1n054ur - telegram2mailbot stars - telegram2mailbot forks - telegram2mailbot

telegram2mailbot

telegram2mailbot

Simple telegram bot hosted on replit using flask, It forwards messages using the mailgun api.

Register accounts + initial Setup

0.1 You will need an account(free) on replit to host this project so it runs 24/7 in the cloud. The free tier is fine, make sure to use environment variables like described below.

0.2 You also need an account(free) with mailgun to use there api to send emails. Make a note of the "private api key" in settings & your domain (starts with "sandbox..mailgun.org") and finally add recipient email. (If emails end up in spam you can create a custom rule on gmail etc)

0.3 Create a bot using botfather and get the telegram api. Make a note of api key" before closing BotFather Chat

Set up and deploy bot on replit

  1. Create new project using python. Name it anything.
  2. Install the following packages: (i) requests (ii) Flask (iii) pyTelegramBotAPI
  3. Add environment variables (i) MAILGUN_KEY (ii) TELEGRAM_KEY (iii) URL
  4. Copy code for main.py from this repo replace "<MAILGUN_DOMAIN>" with your domain
  5. Create new file called keep_alive.py and copy the code from keep_alive.py into it.
  6. Run code and test your bot. Bot should welcome you to the room and forward every message it receives to the email you specified.
  7. You can publish the repl, run it and close the tab and your bot will keep running in the background 24/7 for free!!

About

Simple telegram bot hosted on replit using flask, It forwards messages using the mailgun api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published