Git Product home page Git Product logo

telegram-referral-bot's Introduction

Telegram Referral Bot

Script to add Telegram accounts as referrals to bots, using your invite code

Screenshoot

1. Install necessary libraries

pip install -r requirements.txt

2. Open the .env file and edit the data according to your needs

Description for fileds

  • BOT_NAME - The public name of the bot without the @ symbol (e.g., example_random_bot)
  • COUNT - The quantity of accounts to be used
  • REFER_ID - Your referral ID obtained from the bot (e.g., t.me/example_random_bot?start=12345, ONLY set 12345)
  • CHANNEL_NAME - The username of the channel that must be joined [OPTIONAL]
  • DELAY_MIN - The minimum delay in seconds between each account's operation
  • DELAY_MAX - The maximum delay in seconds between each account's operation

2.1 If you use pyrogram string sessions, follow steps: 4 ,5 and 8

3. Retrieve the API_ID and API_HASH for each account

  • Go to https://my.telegram.org. Log in to the site and create a new application; it will provide you with your credentials

4. Create a file for your credentials, such as accounts.txt, and input the data in the following format:

Example

SESSION_NAME:API_ID:API_HASH
MY_ACCOUNT_1:11223344:d54d1702ad0f8326224b817c796763c9

Or if you've got pyrogram string sessions, just pop each one on a new line like this:

Ag1C11H4AJxbIL5Cr4xovee6MlhrE0XYJud9h_w4RbADPko_-BQufNvWzAzci_4_1EEv623CFNTqRhlL_4qnwL_C3SuMRXYgR89LOSjbE8YO8yIiA0Dctyt5BwdinvMFFm6CEqhzhMzFXoqwCjAMCF9BWkUdJ0WqXkUjxkWO68rJXRIDLl2PXqEGOijZRLnVQIf2H8oJAuAe8Wo7nfYFuFQJAJH7CvpFiY2VZWeBVjSrgWspbTY3Kiy5q7EBrkHFeZvF5y5N_fWnkrAAWYmLN2zctOLuRm2SJ2DQ2mzZdYjKs4Dxzu1QeHTnRdnDCgE9SjEp2C3RFioZDy38105ao_da6owAAAAB3o_RZAA
Ag2C21H4AJxbIL5Cr4xovee6MlhrE0XYJud9h_w4RbADPko_-BQufNvWzAzci_4_1EEv623CFNTqRhlL_4qnwL_C3SuMRXYgR89LOSjbE8YO8yIiA0Dctyt5BwdinvMFFm6CEqhzhMzFXoqwCjAMCF9BWkUdJ0WqXkUjxkWO68rJXRIDLl2PXqEGOijZRLnVQIf2H8oJAuAe8Wo7nfYFuFQJAJH7CvpFiY2VZWeBVjSrgWspbTY3Kiy5q7EBrkHFeZvF5y5N_fWnkrAAWYmLN2zctOLuRm2SJ2DQ2mzZdYjKs4Dxzu1QeHTnRdnDCgE9SjEp2C3RFioZDy38105ao_da6owAAAAB3o_RZAA
Ag3C31H4AJxbIL5Cr4xovee6MlhrE0XYJud9h_w4RbADPko_-BQufNvWzAzci_4_1EEv623CFNTqRhlL_4qnwL_C3SuMRXYgR89LOSjbE8YO8yIiA0Dctyt5BwdinvMFFm6CEqhzhMzFXoqwCjAMCF9BWkUdJ0WqXkUjxkWO68rJXRIDLl2PXqEGOijZRLnVQIf2H8oJAuAe8Wo7nfYFuFQJAJH7CvpFiY2VZWeBVjSrgWspbTY3Kiy5q7EBrkHFeZvF5y5N_fWnkrAAWYmLN2zctOLuRm2SJ2DQ2mzZdYjKs4Dxzu1QeHTnRdnDCgE9SjEp2C3RFioZDy38105ao_da6owAAAAB3o_RZAA

5. If you plan to use a proxy, create a file for it in this format:

NO PROXY (leave file empty)
IP:PORT
IP:PORT:LOGIN:PASSWORD

6. Create session files and authorize on each account

python bot.py --auth --tokens accounts.txt

7. After authorization is complete, session files will be generated in the 'sessions' folder

8. Run the script to begin inviting accounts using your referral code

python bot.py --run --tokens accounts.txt

or with string session

python bot.py --run --strings --tokens accounts.txt

or with proxy

python bot.py --run --tokens accounts.txt --proxies proxies.txt

If the bot requires joining a channel, you should set up the channel name in the .env file and follow the command below

python bot.py --run --tokens accounts.txt --channel

Note: All files, such as accounts.txt and proxies.txt, must be located in the root of the project folder

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. If the script returns an error, open an issue with the provided error message

License

MIT

Involved libraries

Responsibility

All materials are provided for educational purposes only. The author does not bear the responsibility of the consequences of use by other users

telegram-referral-bot's People

Contributors

svtcore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

telegram-referral-bot's Issues

Not working

Hi man its not worked at all always show me error please if can help me my telegram is @Lobersy
Please i need it

the bot dont make refers

i was doing all steps but dont make refer
can you help me please? maybe i cant understand the script

not working

Hey bro, i just found your project and tried to get a referral on @hamster_kombat_bot and it didnt worked. I recieved a message: '''... has sent start command to the bot @hamster_kombat_bot
Sent 1/1
Done'''
but the number of my referrals are still the same. Does this script actually launch the app or its just sending '/start' message? Btw, i faced another problem when i tried to use proxy with authentication:

'''proxy_type=getattr(socks, proxy.get("scheme").upper()),
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'upper''''

I just added 'scheme=str('socks5')' in 'proxy=dict(hostname=ip..' in main.py and auth.py and it worked(hope it will help others who will face this problem)

And I want to say that I really appreciate your work and that you shared your code here with detailed description(so that even as stupid as I could figure everything out), thanks a lot for that and good luck in all your beginnings

How to fix this error

In tl_object.py in line 34
This is the code
def read(cls, b: BytesIO, *args: Any) -> Any:

    return cast(TLObject, objects[int.from_bytes(b.read(8), "little")]).read(b, *args)

I have changed the number 8 from 4 and to 16 but the same error is going on what to do, I am not very experienced in python
This is the error

"D:\Py Interpreter\Scripts\python.exe" bot.py --auth --tokens accounts.txt
Traceback (most recent call last):
File "D:\TRB\telegram-referral-bot-main\bot.py", line 33, in
auth.start()
File "D:\TRB\telegram-referral-bot-main\classes\auth.py", line 38, in start
self.app.start()
File "D:\Py Interpreter\Lib\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\Py Interpreter\Lib\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
^^^^^^^^^^^^^^^^^^^^
File "D:\Py Interpreter\Lib\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect
await self.load_session()
File "D:\Py Interpreter\Lib\site-packages\pyrogram\client.py", line 637, in load_session
await Auth(
File "D:\Py Interpreter\Lib\site-packages\pyrogram\session\auth.py", line 274, in create
raise e
File "D:\Py Interpreter\Lib\site-packages\pyrogram\session\auth.py", line 89, in create
res_pq = await self.invoke(raw.functions.ReqPqMulti(nonce=nonce))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Py Interpreter\Lib\site-packages\pyrogram\session\auth.py", line 67, in invoke
return self.unpack(response)
^^^^^^^^^^^^^^^^^^^^^
File "D:\Py Interpreter\Lib\site-packages\pyrogram\session\auth.py", line 60, in unpack
return TLObject.read(b)
^^^^^^^^^^^^^^^^
File "D:\Py Interpreter\Lib\site-packages\pyrogram\raw\core\tl_object.py", line 34, in read
return cast(TLObject, objects[int.from_bytes(b.read(8), "little")]).read(b, *args)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 0

Process finished with exit code 1

Help

Hi can you do a detailed video on how to do this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.