Skip to main content

چیست و چرا؟

کتابخانه های زیادی برای اتصال و ساخت ربات بله که به آن بازوی بله هم می گویند وجود دارد. اما تا کنون هیچ کتابخانه رو ندیدم که امکان کنترل خود اکانت رو فراهم بکنه و بله هم مستندات در این باره منتشر نکرده. برای یه پروژه به کنترل حساب بله نیاز پیدا کردم پس این کتابخانه رو ساختم در مراحل آزمایشی هست و گسترده و پشتیبانی از تمام امکانات رو نداره چون در حد نیازه پروژه خودم نوشته شده

اگر کسی مایل بود می تونه درخواست های توسعه رو به گیت هاب بفرسته و د گسترش این کتابخانه کمک کنه

https://github.com/mr-r0ot/BaleAccountApi

مستندات

نصب

pip install BaleAccountApi

استفاده

#افزودن
from BaleAccountApi import BaleAccountApi


# ساخت یک سشن جدید
home = BaleAccountApi.start(hide=False) # اگر می خواید نمایش داده بشه
#home = BaleAccountApi.start(hide=True) # اگر می خواهید مرورگر مخفی بشه 



# ارسال یه کد تایید(سشن همواره باید به تابع ها پاس داده شود)
if BaleAccountApi.send_otp_code(home, "09123456789"):
    print("با موفقیت ارسال شد")
else:
    print("خطا")


# گرفتن کد تایید و ورود به حساب
while True:
    code = input("Enter code: ")
    if BaleAccountApi.login(home, code):
        print("خوش اومدی :)")
        break
    else:
        print("کد اشتباه بود")

# در بله دو نوع id وجود دارد:
# یکی به صورت متنی و رشته است و یکی آیدی ععدی
# برای استفاده در این کتابخانه نیاز به آیدی عددی داریم پس با این تابع می توانیم:
# تبدیل آیدی رشته   به    آیدی ععدی قابل استفاده
ID='EnterYourBaleStringID' 
chat_uid = BaleAccountApi.convert_id_to_uid(home, ID)
print(f' Caht UID : {chat_uid}')



# باز کردن یه چت با آیدی عددی
# می تواند گروه کانال پیوی و... باشد
BaleAccountApi.open_chat(home, chat_uid=chat_uid)

# مثال خواندن پیام ها
out = BaleAccountApi.readmessages(home)
print(out)

# مثال ارسال پیام
if BaleAccountApi.send_message(home, 'HIII :) '):
    print("Sended :)")
else:
    print('My bad :(')

Metadata

Release files for BaleAccountApi 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BaleAccountApi 1.0.5
File Size Uploaded Provenance
baleaccountapi-1.0.5.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for BaleAccountApi 1.0.5
File Interpreter ABI Platform
baleaccountapi-1.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 8.6 kB

Release files / baleaccountapi-1.0.5.tar.gz

Download URL baleaccountapi-1.0.5.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dc83a63ed0c13f6e384b8d44a939e51ea05a072492381f4479224966c54e2af4
BLAKE2b-256 checksum
How to use checksums
5c0f082c37d9f6c2e08be453f995afb9db40b3090098f976cb851189bfb1b789
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.9

Release files / baleaccountapi-1.0.5-py3-none-any.whl

Download URL baleaccountapi-1.0.5-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f35b0b76acd85aa5d7094c072d555a2896d061620654f95aea7c300df02a41fc
BLAKE2b-256 checksum
How to use checksums
d20a13f9b13f95e1927cbc191f1f0b7669e2cf3cb28cc6dbc601b24f7de9fffd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.9

Security for BaleAccountApi 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page