Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustLigh committed Apr 11, 2024
1 parent f772fff commit cd6e194
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion AminoLightPy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__author__ = 'AugustLight'
__license__ = 'MIT'
__copyright__ = 'Copyright 2024 AugustLight'
__version__ = '0.1.3'
__version__ = '0.1.4'

from .acm import ACM
from .client import Client
Expand Down
5 changes: 3 additions & 2 deletions AminoLightPy/lib/util/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ def __init__(self, data):
extensions = data.get("extensions") or {}
linkInfo = extensions.get("linkInfo") or {}

self.community: Community = Community(extensions.get("community")).Community
community = Community(extensions.get("community")).Community
self.community: Community = community
self.path = data.get("path")
self.objectType = linkInfo.get("objectType")
self.shortCode = linkInfo.get("shortCode")
Expand All @@ -621,7 +622,7 @@ def __init__(self, data):
self.shortUrl = linkInfo.get("shareURLShortCode")
self.fullUrl = linkInfo.get("shareURLFullPath")
self.comIdPost = linkInfo.get("ndcId")
self.comId = self.comIdPost or extensions.get("community") or {}.get("ndcId")
self.comId = self.comIdPost or community.comId

@property
def FromCode(self):
Expand Down
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,33 @@ AminoApps python framework to create bots and scripts easily.

<h2 align="center">Usage</h2>

Install the dependencies and start the coding.
Install the package :

```sh
pip install amino.light.py
`pip install amino.light.py`

---

Import the `Client` and `SubClient` objects into your bot's code, and create your own help manual :

```py
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):
if data.message.author.userId != client.profile.userId: # Do not answer to myself
# Create SubClient object
sub_client = SubClient(comId=data.comId, profile=client.profile)
if data.message.content.startswith('/help'):
sub_client.send_message(chatId=data.message.chatId, message=help_message)
```

<h2 align="center">Example</h2>
Expand All @@ -51,4 +74,4 @@ If you can't find what you're looking for or need help with this library, you ca

* *This is not my project. Amino libraries already existed before me. I just wanted to create a simple and effective way to support bots*

MIT
* *This is working only with the Python.*
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

setup(
name="amino.light.py",
version="0.1.3",
version="0.1.4",
url="https://github.com/AugustLigh/AminoLightPy",
license="MIT",
description="Best Amino.py alternative",
Expand Down

0 comments on commit cd6e194

Please sign in to comment.