How can I run telegram bot on Android phone ?

Fmajor7
2 min readJun 22, 2020

--

In this tutorial, I will show you the way I implemented basic functions like: scrape members even add members to Telegram group on Android phone.

If you can find open codes to scrape members from telegram groups and add those messes to the different group. If not, you could visit my repository.

Requirements

  1. Android phone: Because of my main phone run Android OS and this guide is just compatible to Android. You could decide to use similar software or applications in this article when you did not use Android.
  2. Solution to move files from PC to your phone: I edited some files for 2 main function (scraping and adding) on PC before putting to the phone. Many ways to do that. You could upload from cloud or send as attach file to your phone.
  3. Application on Android device: Pydroid 3 was used in this article. This Actually, this was language learning application, It supported installing external library, terminal to interact with files/commands. Of course, you could get similar one from CH Play.
  4. Telethon API: We will work with a major library which is Python library and we use Python language in this application.

Let’s start

We need to prepare python files for scrape data in telegram group.

We have: api_id, api_hash and phone. They are variable that you have to create before (refer this link).

Scrape file will return a list in csv format all members in optional group. That includes: username, User ID, access hash, group name, group ID, …

We have to get another file to add member, see code below:

Open your Pydroid application, choose terminal and move to your directory. Make sure that necessary files (add.py and .csv) in that directory.

Choose “Terminal”
Move to specific directory by “cd” command
Run by command “python add.py members.csv“

Just run and wait your results.

In this guide, we concentrated on running on mobile platform instead of focusing on programming (scrape or add member from a group to other one).

You can refer scraping on this, adding on this.

Happy hacking !!!

--

--