Skip to content
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
4 changes: 1 addition & 3 deletions _utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,4 @@ def gen_random_sys_version():

@run_in_exc
def gen_random_app_version():
return f"Telegram Android 8.{str(random.randint(5, 6))}." + str(
random.randint(3, 6)
)
return f"Telegram Android 8.{random.randint(5, 6)}.{random.randint(3, 6)}"
10 changes: 6 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def pin_g(c: Client, m):
@bot_client.on_message(filters.command("add", ["!", "/"]))
async def add_user(c: Client, m: Message):
_m = await m.reply("Please Wait..")
if not m.from_user.id == OWNER_ID:
if m.from_user.id != OWNER_ID:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function add_user refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

if not (await is_users_sudo(m.from_user.id)):
return await _m.edit("<b>[ACCESS_DENIED]:</b> <code>You are not my owner.</code>")
if m.reply_to_message and m.reply_to_message.from_user:
Expand Down Expand Up @@ -63,7 +63,7 @@ async def add_user(c: Client, m: Message):
async def st_(c, m: Message):
no_of_accounts = 0
_m = await m.reply("PROCESSING..")
if not m.from_user.id == OWNER_ID:
if m.from_user.id != OWNER_ID:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function st_ refactored with the following changes:

if not (await is_users_sudo(m.from_user.id)):
return await _m.edit("<b>[ACCESS_DENIED]:</b> <code>You are not my owner.</code>")
api_key = await m.from_user.ask("Please Enter your API Key :")
Expand All @@ -76,7 +76,9 @@ async def st_(c, m: Message):
balance = GetBalance().request(wrapper)
except Exception as e:
return await _m.edit(f"<b>[API_KEY_ERROR]:</b> <code>{e.args[1]} - Unable to get balance. check your api key please!</code>")
await _m.edit("<b>[API_KEY_OK]:</b> <code>Your Balance is :</code> <code>{}</code>".format(balance))
await _m.edit(
f"<b>[API_KEY_OK]:</b> <code>Your Balance is :</code> <code>{balance}</code>"
)
country_ = await m.from_user.ask("Enter Country Code :")
await country_.delete()
await country_.request.delete()
Expand Down Expand Up @@ -134,7 +136,7 @@ async def st_(c, m: Message):

@bot_client.on_message(filters.command("stop", ["/", "!"]))
async def stop_(c, msg: Message):
if not msg.from_user.id == OWNER_ID:
if msg.from_user.id != OWNER_ID:
Comment on lines -137 to +139
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function stop_ refactored with the following changes:

  • Simplify logical expression using De Morgan identities (de-morgan)

if not (await is_users_sudo(msg.from_user.id)):
return await msg.reply("<b>[ACCESS_DENIED]:</b> <code>You are not my owner.</code>")
m = await msg.reply("Please WAIT....")
Expand Down
2 changes: 1 addition & 1 deletion make_acc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def make_accounts(msg: Message, wrapper: Sms, country: str, range_: int =
if random_proxy:
proxy_usage[random_proxy['hostname']] = 1
while True:
if (range_) and (int(nacc) >= int(range_)) and (range_ > 0):
if range_ and int(nacc) >= range_ and range_ > 0:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function make_accounts refactored with the following changes:

break
nacc += 1
try: activation = GetNumber(service=SmsService().Telegram, country=country, operator=SmsTypes.Operator.any).request(wrapper)
Expand Down