Elegant and powerful Python framework for creating AminoApps bots and scripts
๐ Features โข ๐ Usage โข ๐ Example โข ๐ Documentation โข ๐ Notes
๐ฅ Feature | ๐ Description |
---|---|
โก Optimization | Most of the code has been rewritten for maximum performance |
โ๏ธ Backward compatibility | Write code with correct syntax without compatibility issues |
๐ฎ Commands support | Go even further with new requests and capabilities |
๐ Supported on iPhones | Works for free, without jailbreak and restrictions |
pip install amino.light.py
Import the Client
and SubClient
objects into your bot's code:
from AminoLightPy import Client, SubClient
# Your help message
help_message = """
๐ Welcome!
๐ This is help page.
"""
# Create Client object
client = Client()
# Login into account
client.login("example_mail@gmail.com", "example_password")
# And display the help!
@client.event("on_text_message")
def on_message(data):
# Do not answer to myself
if data.message.author.userId != client.profile.userId:
# Create SubClient object
sub_client = SubClient(comId=data.comId, profile=client.profile)
# Process help command
if data.message.content.startswith('/help'):
sub_client.send_message(chatId=data.message.chatId, message=help_message)
Simply copy the code above and type /help
in the chat to see your bot in action.
Also, take a look at interactive examples in our documentation!
Complete API reference for building amazing Amino bots
Main API connection class
from AminoLightPy import Client
# Initialize client with default settings
client = Client()
# OR
client = Client(socket_enabled=False)
#if you not need websocket (faster)
# With custom settings
client = Client(deviceId="your_device_id", proxies={"http": "http://proxy.example.com"})
# Universal login (recommended)
client.login(email_or_phone="example@gmail.com", password="your_password")
# Alternative authentication methods
client.login_email(email="example@gmail.com", password="your_password")
client.login_phone(phoneNumber="+1234567890", password="your_password")
client.login_sid(SID="your_sid_here") # SIDs are cached automatically when using client.login()
# OR
client.login(email_or_phone="example@gmail.com", password="your_password", self_device=False)
# If you want a random DeviceId for each login
@client.event("on_text_message")
def on_message(data):
print(f"Received message: {data.message.content}")
@client.event("on_image_message")
def on_image(data):
print(f"Received image from: {data.message.author.nickname}")
Available Events | Description |
---|---|
on_text_message | Triggered when a text message is received |
on_image_message | Triggered when an image message is received |
on_youtube_message | Triggered when a YouTube link is shared |
on_voice_message | Triggered when a voice message is received |
on_sticker_message | Triggered when a sticker is received |
on_join_chat | Triggered when someone joins a chat |
on_leave_chat | Triggered when someone leaves a chat |
# Get list of joined communities
communities = client.sub_clients(size=100)
# Search for a community
found_communities = client.search_community("amino_id")
# Join/Leave community
client.join_community(comId=123456)
client.leave_community(comId=123456)
# Send join request
client.request_join_community(comId=123456, message="i want to join๐ญ๐")
Community-specific operations
from AminoLightPy import Client, SubClient
client = Client()
client.login("email", "password")
# Create a SubClient for a specific community
sub_client = SubClient(comId=123456, profile=client.profile)
# Text message
sub_client.send_message(
chatId="chat-id-here",
message="Hello world!"
)
# Image message
with open("image.jpg", "rb") as image:
sub_client.send_message(
chatId="chat-id-here",
file=image
)
# Warn! You need add `fileType="audio"` for voice message
# Mentions
sub_client.send_message(
chatId="chat-id-here",
message="Hello @user!",
mentionUserIds=["user-id-here"]
)
# Rich content (embedded links)
sub_client.send_message(
chatId="chat-id-here",
message="Check this out!",
linkSnippet={
"link": "https://example.com",
"title": "Example Website",
"mediaType": 100,
"mediaSourceWidth": 500,
"mediaSourceHeight": 300
}
)
# Create a new chat
sub_client.start_chat(
userId="user-id",
message="Hi there!"
)
# Create a group chat
sub_client.start_chat(
userIds=["user-id-1", "user-id-2"],
title="Our Group",
message="Welcome everyone!"
)
# Get joined chats
chats = sub_client.get_chat_threads(start=0, size=100)
# Get chat messages
messages = sub_client.get_chat_messages(
chatId="chat-id-here",
start=0,
size=100
)
# Invite to chat
sub_client.invite_to_chat(
chatId="chat-id-here",
userIds=["user-id-1", "user-id-2"]
)
# Leave chat
sub_client.leave_chat(chatId="chat-id-here")
# Create a blog post
sub_client.post_blog(
title="My Blog Post",
content="This is content for my blog post",
imageList=[open("image_1.png", "rb"), open("image_2.png", "rb")]
)
# Create a wiki
sub_client.post_wiki(
title="Wiki Title",
content="Wiki content here",
icon=open("icon.png", "rb")
)
# Upload media
media = sub_client.upload_media(file=open("image.jpg", "rb"))
# Comment on content
sub_client.comment(blogId="blog-id", message="Great post!")
sub_client.comment(wikiId="wiki-id", message="Useful information!")
# Like content
sub_client.like_blog(blogId="blog-id")
sub_client.like_comment(commentId="comment-id")
# Follow/Unfollow users
sub_client.follow(userId="user-id")
sub_client.unfollow(userId="user-id")
# Block/Unblock users
sub_client.block_user(userId="user-id")
sub_client.unblock_user(userId="user-id")
# Hide content
sub_client.hide(blogId="blog-id", reason="Violates community guidelines")
# Ban/Unban users
sub_client.ban(userId="user-id", reason="Spamming")
sub_client.unban(userId="user-id", reason="Appeal accepted")
# Feature content
sub_client.feature(time=1, blogId="blog-id")
sub_client.unfeature(blogId="blog-id")
# Strike users
sub_client.strike(userId="user-id", time=1, title="Spam", reason="Excessive messaging")
# Warn users
sub_client.warn(userId="user-id", reason="Minor rule violation")
# Show "typing..." indicator
with sub_client.typing(chatId="chat-id-here"):
# This block will show typing indicator while executing
time.sleep(2)
sub_client.send_message(chatId="chat-id-here", message="Hello!")
# Show "recording..." indicator
with sub_client.recording(chatId="chat-id-here"):
# Prepare a voice message
time.sleep(3)
sub_client.send_message(chatId="chat-id-here", file=open("demo.mp3", "rb"), fileType="audio")
For complete API reference, see the official documentation.
If you can't find what you're looking for or need help with this library:
- Telegram: augustlight
- Discord: engineer48
We will be glad to help!
This is not my original project. Amino libraries already existed before me. I just wanted to create a simple and effective way to support bots.
This framework works only with Python.