Skip to content

karthikmprakash/Temp-e-mail-Telegram-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

temp-e-mail

A handy bot to fetch temporary emails for your next Signup!
Explore the docs »

Report Bug · Request Feature

Temporary Email genration with Telegram Bot: Overview

  • Created a bot to generate username , temporary email and password for websites that could potentially track your personal data.
  • It uses the 10minmail service to generate a new email instance and returns back to the user.
  • Users can easily interact with the bot with the Markup Keyboard that primarily focuses on the Bot's features
  • Uses webhooks instead of polling to increase the bots response time and for effecient requests handling

Code and Resources Used

Python Version: 3.7
Packages: python-telegram-bot requests beautifulsoup4 python-dotenv urllib3
For Web Framework Requirements: pip install -r requirements.txt
Pyhton-telegram-bot Github: https://github.com/python-telegram-bot/python-telegram-bot
Telegram Bot API: https://core.telegram.org/bots/api#message
Telegram Bot Documentation: https://python-telegram-bot.readthedocs.io/en/stable/index.html
Telegram Webhooks: https://github.com/gcatanese/TelegramBotDemo/blob/main/telegram_bot/telegram_bot.py
Run on Boot(Linux): https://tecadmin.net/setup-autorun-python-script-using-systemd/

Usage

To run the script on system reboot (Ubuntu)

  1. Have the python application ready
  2. Create a Service File
    • The file must have .service extension under /lib/systemd/system/ directory
    • sudo vi /lib/systemd/system/telegram_bot.service
    • and add the following content in it. Change Python script filename ad location. Also update the Description.
    • [Unit]
      Description=Dummy Service
      After=multi-user.target
      [email protected]
      
      [Service]
      Type=simple
      ExecStart=/usr/bin/python3 /home/user-directory/path-to-python-script
      StandardInput=tty-force
      
      [Install]
      WantedBy=multi-user.target
  3. Enable Newly Added Service
    • Your system service has been added to your service. Let’s reload the systemctl daemon to read new file. You need to reload this deamon each time after making any changes in in .service file.
    • sudo systemctl daemon-reload
    • Now enable the service to start on system boot, also start the service using the following commands.
    • sudo systemctl enable telegram_bot.service
      sudo systemctl start telegram_bot.service
    • Finally check the status of your service as following command
    • sudo systemctl status telegram_bot.service

Working Model

Anyone can make use of the bot by searching for @temp_e_mail_bot in the telegram messenger

Productionization

There are bunch of different ways to get the bot up and working. Its feasible to use polling while testing the bot in the local environment but once its in the production stage ,its better to use webhooks with a cloud server. You can build your own too!

  • Deployment on a Raspberry Pi
  • IAAS Servers for ex: Amazon AWS EC2 , MS Azure
  • PAAS Server for ex: Heroku , Rackspace

About

A handy bot to fetch temporary emails for your next Signup!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published