Skip to content

AugustLigh/AminoLightPy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

57 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โœจ AminoLightPy โœจ

AminoLightPy Banner

๐Ÿš€ Elegant and powerful Python framework for creating AminoApps bots and scripts

GitHub release Documentation License Python


๐Ÿ“ Quick Navigation

๐Ÿ”ฅ Features โ€ข โšก Quick Start โ€ข ๐Ÿ“– Documentation โ€ข ๐ŸŽฏ Examples โ€ข ๐Ÿ’ฌ Support


๐ŸŒŸ Features

โšก Performance

Optimized code with maximum efficiency and minimal resource usage

๐Ÿ”„ Compatibility

Seamless backward compatibility with existing Amino bot projects

๐ŸŽฎ Rich Commands

Advanced command system with extensive API coverage

๐Ÿ“ฑ iOS Support

Works on iPhones without jailbreak or restrictions

๐Ÿ›ก๏ธ Reliable

Built-in error handling and connection management

๐ŸŽจ Flexible

Easy customization for any bot requirements


โšก Quick Start

๐Ÿ’ฟ Installation

pip install amino.light.py

๐ŸŽฏ Your First Bot

from AminoLightPy import Client, SubClient, ChatEvent

# Initialize and login
client = Client()
client.login("[email protected]", "your_password")

@client.event(ChatEvent.TEXT_MESSAGE)
def on_message(data):
    if data.message.content.startswith('/hello'):
        sub_client = SubClient(comId=data.comId, profile=client.profile)
        sub_client.send_message(
            chatId=data.message.chatId, 
            message="๐Ÿ‘‹ Hello! I'm your new Amino bot!"
        )
๐ŸŽ‰ That's it! Your bot is now running and ready to respond to messages.

๐Ÿ“– Documentation

๐Ÿ—๏ธ Core Components

๐Ÿ”Œ Client - Main Connection Handler

The Client class manages your connection to Amino services and handles global operations.

๐Ÿš€ Initialization

from AminoLightPy import Client

# Basic setup
client = Client()

# Advanced configuration
client = Client(
    deviceId="your_device_id",
    socket_enabled=True,  # Enable real-time events
    proxies={"http": "http://proxy.example.com"}
)

๐Ÿ” Authentication Options

# Universal login (recommended)
client.login("[email protected]", "password123")

# Specific methods
client.login_email("[email protected]", "password123")
client.login_phone("+1234567890", "password123")
client.login_sid("your_session_id")  # Use cached session

โšก Event System

@client.event(ChatEvent.TEXT_MESSAGE)
def handle_text(data):
    print(f"๐Ÿ“ Message: {data.message.content}")

@client.event(ChatEvent.IMAGE_MESSAGE)
def handle_image(data):
    print(f"๐Ÿ–ผ๏ธ Image from: {data.message.author.nickname}")

@client.event(ChatEvent.VOICE_MESSAGE)
def handle_voice(data):
    print(f"๐ŸŽต Voice message received!")

๐ŸŽฏ Available Events

Event Trigger
on_text_message Text messages
on_image_message Image uploads
on_voice_message Voice messages
on_youtube_message YouTube links
on_sticker_message Stickers
on_join_chat User joins chat
on_leave_chat User leaves chat
๐Ÿ  SubClient - Community Operations

The SubClient handles all community-specific actions and messaging.

๐ŸŽฏ Setup

sub_client = SubClient(comId=123456, profile=client.profile)

๐Ÿ’ฌ Messaging

# Send text message
sub_client.send_message(chatId="chat_id", message="Hello World! ๐ŸŒ")

# Send image with caption
with open("image.jpg", "rb") as img:
    sub_client.send_message(
        chatId="chat_id", 
        message="Check this out! ๐Ÿ“ธ",
        file=img
    )

# Mention users
sub_client.send_message(
    chatId="chat_id",
    message="Hey @user, look at this! ๐Ÿ‘‹",
    mentionUserIds=["user_id_here"]
)

๐Ÿ’พ Rich Content

# Embed links with preview
from base64 import b64encode

with open("preview.jpg", "rb") as preview:
    sub_client.send_message(
        chatId="chat_id",
        message="Amazing content! โœจ",
        linkSnippet=[{
            "link": "https://example.com",
            "mediaType": 100,
            "mediaUploadValue": b64encode(preview.read()).decode(),
            "mediaUploadValueContentType": "image/jpeg"
        }]
    )

๐ŸŽจ Content Creation

# Create blog post
sub_client.post_blog(
    title="๐ŸŒŸ My Amazing Blog Post",
    content="This is where I share my thoughts...",
    imageList=[open("img1.png", "rb"), open("img2.png", "rb")]
)

# Create wiki entry
sub_client.post_wiki(
    title="๐Ÿ“š Helpful Wiki",
    content="Everything you need to know about...",
    icon=open("wiki_icon.png", "rb")
)

๐ŸŽญ Interactive Features

# Show typing indicator
with sub_client.typing(chatId="chat_id"):
    # Simulate thinking time
    time.sleep(2)
    sub_client.send_message(chatId="chat_id", message="Done thinking! ๐Ÿ’ญ")

# Show recording indicator
with sub_client.recording(chatId="chat_id"):
    time.sleep(3)  # Prepare voice message
    with open("voice.mp3", "rb") as voice:
        sub_client.send_message(
            chatId="chat_id", 
            file=voice, 
            fileType="audio"
        )
๐Ÿ‘‘ Moderation Tools (Staff Only)

Advanced moderation features for community leaders and staff.

# Content moderation
sub_client.hide(blogId="blog_id", reason="Inappropriate content")
sub_client.feature(time=3, blogId="blog_id")  # Feature for 3 hours
sub_client.unfeature(blogId="blog_id")

# User management
sub_client.ban(userId="user_id", reason="Spam violation")
sub_client.unban(userId="user_id", reason="Appeal approved")
sub_client.strike(
    userId="user_id", 
    time=24, 
    title="Community Guidelines", 
    reason="Inappropriate behavior"
)
sub_client.warn(userId="user_id", reason="Minor rule violation")

๐ŸŽฏ Examples

๐Ÿค– Bot Examples

๐ŸŽฎ Command Bot
from AminoLightPy import Client, SubClient
import random

client = Client()
client.login("email", "password")

commands = {
    '/help': '๐Ÿ“‹ Available commands:\n/dice - Roll a dice\n/joke - Get a random joke',
    '/dice': lambda: f'๐ŸŽฒ You rolled: {random.randint(1, 6)}!',
    '/joke': lambda: random.choice([
        "Why do programmers prefer dark mode? Because light attracts bugs! ๐Ÿ›",
        "How many programmers does it take to change a light bulb? None, that's a hardware problem! ๐Ÿ’ก"
    ])
}

@client.event(ChatEvent.TEXT_MESSAGE)
def handle_command(data):
    message = data.message.content.lower()
    
    if message in commands:
        sub_client = SubClient(comId=data.comId, profile=client.profile)
        
        response = commands[message]
        if callable(response):
            response = response()
            
        sub_client.send_message(
            chatId=data.message.chatId,
            message=response
        )
๐ŸŽจ Welcome Bot
@client.event(ChatEvent.USER_JOINED)
def welcome_user(data):
    sub_client = SubClient(comId=data.comId, profile=client.profile)
    
    welcome_message = f"""
    ๐ŸŽ‰ Welcome to our community, {data.message.author.nickname}!
    
    ๐Ÿ“ Please read our guidelines
    ๐Ÿ’ฌ Feel free to introduce yourself
    ๐Ÿค Have fun and be respectful!
    """
    
    sub_client.send_message(
        chatId=data.message.chatId,
        message=welcome_message
    )
๐Ÿ”„ Auto-Responder
auto_responses = {
    'hello': '๐Ÿ‘‹ Hello there! How can I help you today?',
    'bye': '๐Ÿ‘‹ Goodbye! Have a great day!',
    'thanks': '๐Ÿ˜Š You\'re welcome! Happy to help!',
}

@client.event(ChatEvent.TEXT_MESSAGE)
def auto_respond(data):
    message = data.message.content.lower()
    
    for keyword, response in auto_responses.items():
        if keyword in message:
            sub_client = SubClient(comId=data.comId, profile=client.profile)
            sub_client.send_message(
                chatId=data.message.chatId,
                message=response
            )
            break

๐Ÿ’ฌ Support

๐Ÿค Get Help & Connect

๐Ÿ’ฌ Telegram
@augustlight

๐Ÿ’™ Discord
engineer48

๐Ÿ“š Documentation
ReadTheDocs


๐ŸŽ–๏ธ Contributing

We welcome contributions! Whether it's:

  • ๐Ÿ› Bug reports
  • โœจ Feature requests
  • ๐Ÿ“ Documentation improvements
  • ๐Ÿ”ง Code contributions

๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐ŸŒŸ Show Your Support

If this project helps you, please consider giving it a โญ on GitHub!


๐Ÿ’ก This framework builds upon the foundation of existing Amino libraries, enhanced for simplicity and effectiveness.

๐Ÿ Compatible with Python 3.10+ โ€ข Works on all platforms