Skip to content
This repository was archived by the owner on Dec 13, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
API_ID=
API_HASH=

REF_MODE=
REF_ID=

SLEEP_BETWEEN_START=
ERRORS_BEFORE_STOP=
USE_PROXY_FROM_FILE=
Expand Down
3 changes: 2 additions & 1 deletion bot/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class Settings(BaseSettings):

API_ID: int
API_HASH: str

REF_MODE: bool = False
REF_ID: str
SLEEP_BETWEEN_START: list[int] = [20, 360]
ERRORS_BEFORE_STOP: int = 3
USE_PROXY_FROM_FILE: bool = False
Expand Down
8 changes: 8 additions & 0 deletions bot/core/claimer.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ async def get_tg_web_data(self, proxy: str | None) -> str:
headers["user_auth"] = str(self.user_id)
except (Unauthorized, UserDeactivated, AuthKeyUnregistered):
raise InvalidSession(self.session_name)
if settings.REF_MODE:
gen_ref = settings.REF_ID
logger.info(f'{self.session_name} | Sending message with ref {gen_ref}')
await asyncio.sleep(5)
await self.tg_client.send_message("MMproBump_bot", f'/start {gen_ref}')
await asyncio.sleep(5)
logger.success(f'{self.session_name} | Sent message with ref! {gen_ref}')

web_view = await self.tg_client.invoke(RequestWebView(
peer=await self.tg_client.resolve_peer('MMproBump_bot'),
bot=await self.tg_client.resolve_peer('MMproBump_bot'),
Expand Down