-
Notifications
You must be signed in to change notification settings - Fork 32
How to: Add New Accounts
You can add new accounts to your MasterCryptoFarmBot using two methods:
Using Pyrogram Sessions or Using TgWebAppInitData or WebQuery for Modules.
Pyrogram is a Python client for the Telegram API. Pyrogram is like a Telegram client, but it's a library that you can use to interact with Telegram's API. It's a powerful tool that allows you to create bots, automate tasks, and much more.
🟢 Pros:
- ✅ One-time login for all bot modules.
- ✅ More access to your account.
- ✅ Modules can join channels for tasks.
- ✅ Change names if needed for tasks.
- ✅ Easier to use.
🔴 Cons:
- You need to get Telegram
API_IDandAPI_HASH. - There will be a session in your Telegram account.
- Full access to your account. If you don't trust the bot or you want to install modules from unknown sources, it's better to use the Web Query method.
-
First of all, you need to get Telegram
API_IDandAPI_HASH. Read HowTo: Get Telegram API_ID & API_HASH. -
Navigate to your MasterCryptoFarmBot directory, then run
python add_account.pyon Windows orpython3 add_account.pyon Linux.
🟡🗒️ Note: After adding the account, you need to enable it in the control panel to use it in the modules. Make sure to add a User-Agent to the account in the control panel before enabling it.
Then you will have 2 options:
- You will be asked to enter a session name. You can enter a valid (a-zA-Z0-9) session name of your choice or, to keep it simple, just enter your account's Telegram ID. Session names will be stored locally and can be anything as long as they are not duplicated with another session name!
- Enter the phone number with the country code, for example:
+12345678900or+989123456789. - At this point, Pyrogram will be called and the rest will be handled by Pyrogram. You will have to enter the received code from Telegram and the 2FA password (if you've enabled 2FA).
- Upon successful registration, the application will notify you that the session was created successfully and provide basic info about the session, like userID, name, username, phone number, and session name.
If you already have Pyrogram .session files, you need to import them again as we store the data locally inside accounts.json. Simply move your session files to the /telegram_accounts directory and select this option. The application will check them for validity and notify you if the import was successful or not.
This is needed to attach some important data like user_agent, proxy, and activation status (should the account be used in modules?) to the session.
This method is used to add accounts to the MasterCryptoFarmBot for a specific module using the TgWebAppInitData of the Telegram Web Application. This method is useful when you don't want to use Pyrogram sessions or you don't have access to the phone number of the account you want to add.
🟡 This method is not recommended for users who want to use several accounts with different modules.
🟢 Pros:
- ✅ No need to get
API_IDandAPI_HASH. - ✅ No session in your Telegram account.
- ✅ More secure than Pyrogram sessions for some users.
- ✅ No need to use a phone number to add the account.
🔴 Cons:
- You need to get
WebAppInitDatawhich could be hard for some users. - You need to get
WebAppInitDatafor each module you want to add the account to. - Hard to add if you have a lot of accounts and modules.
- No full control over your account.
- You can't join channels for tasks.
- You can't change names if needed for tasks.
There are several ways to obtain Telegram WebApplication Initial Data, which is used to authorize bots using your Telegram accounts.
-
Open Telegram Desktop and head to Settings > Advanced > Experimental Settings > Enable WebView Inspecting.
-
Open your desired bot's application (Hit Play / Launch Button), then open the developer tools (F12) and go to the Console tab.
-
Paste the following code in the console and hit enter:
copy(Telegram.WebApp.initData);
-
InitData is now copied to your clipboard.
- Open your desired bot's application (Hit Play / Launch Button).
- Once it's loaded, turn off your device's Wi-Fi and mobile data, then refresh the page. You can find the refresh button in the top right corner of the screen.
- You should see a "Webpage not available" message. Copy the URL that includes
#tgWebAppData.
-
Open Telegram Web and head to your desired bot's application (Hit Play / Launch Button).
-
Press F12 to open developer tools, then go to the Console tab.
-
Paste the following code in the console and hit enter:
copy(document.querySelector("iframe")?.src || "No iframe found.");
-
InitData is now copied to your clipboard.
https://major.glados.app/#tgWebAppData%3Dquery_id%3DREDACTED%26user%3D%7B%22id%22%3AREDACTED%2C%22first_name%22%3A%22REDACTED%22%2C%22last_name%22%3A%22%22%2C%22username%22%3A%22REDACTED%22%2C%22language_code%22%3A%22en%22%2C%22is_premium%22%3Atrue%2C%22allows_write_to_pm%22%3Atrue%7D%26auth_date%3DREDACTED%26hash%3DREDACTED%26tgWebAppVersion%3D7.8%26tgWebAppPlatform%3Dweba%26tgWebAppBotInline%3D1%26tgWebAppThemeParams%3D%7B%22bg_color%22%3A%22%23212121%22%2C%22text_color%22%3A%22%23ffffff%22%2C%22hint_color%22%3A%22%23aaaaaa%22%2C%22link_color%22%3A%22%238774e1%22%2C%22button_color%22%3A%22%238774e1%22%2C%22button_text_color%22%3A%22%23ffffff%22%2C%22secondary_bg_color%22%3A%22%230f0f0f%22%2C%22header_bg_color%22%3A%22%23212121%22%2C%22accent_text_color%22%3A%22%238774e1%22%2C%22section_bg_color%22%3A%22%23212121%22%2C%22section_header_text_color%22%3A%22%23aaaaaa%22%2C%22subtitle_text_color%22%3A%22%23aaaaaa%22%2C%22destructive_text_color%22%3A%22%23e53935%22%7DOR - (both will work)
#tgWebAppData%3Dquery_id%3DREDACTED%26user%3D%7B%22id%22%3AREDACTED%2C%22first_name%22%3A%22REDACTED%22%2C%22last_name%22%3A%22%22%2C%22username%22%3A%22REDACTED%22%2C%22language_code%22%3A%22en%22%2C%22is_premium%22%3Atrue%2C%22allows_write_to_pm%22%3Atrue%7D%26auth_date%3DREDACTED%26hash%3DREDACTED%26tgWebAppVersion%3D7.8%26tgWebAppPlatform%3Dweba%26tgWebAppBotInline%3D1%26tgWebAppThemeParams%3D%7B%22bg_color%22%3A%22%23212121%22%2C%22text_color%22%3A%22%23ffffff%22%2C%22hint_color%22%3A%22%23aaaaaa%22%2C%22link_color%22%3A%22%238774e1%22%2C%22button_color%22%3A%22%238774e1%22%2C%22button_text_color%22%3A%22%23ffffff%22%2C%22secondary_bg_color%22%3A%22%230f0f0f%22%2C%22header_bg_color%22%3A%22%23212121%22%2C%22accent_text_color%22%3A%22%238774e1%22%2C%22section_bg_color%22%3A%22%23212121%22%2C%22section_header_text_color%22%3A%22%23aaaaaa%22%2C%22subtitle_text_color%22%3A%22%23aaaaaa%22%2C%22destructive_text_color%22%3A%22%23e53935%22%7DSo basically, copy the whole URL or just #tgWebAppData to the end.
❔ If you have a question, idea, or suggestion, You can create new discussion in the Discussions
🐛 If you encounter a bug or issue, please create a new issue in the Issues section.
For more information and updates, join our 📢 Telegram Channel or join our 💬 Telegram Group for discussion and support.