Using Line Notify more easily
Project description
Lotify - LINE Notify client SDK
Lotify is a LINE Notify client SDK that you can build Notify bot quickly.
Usage
Version suggest >= 3.7
You need a LINE account and create a Notify like this:
initialize instance
from lotify.client import Client
client = Client(
client_id='YOUR_CLIENT_ID',
client_secret='YOUR_CLIENT_SECRET',
redirect_uri='YOUR_URI'
)
Get access token
access_token = client.get_access_token(code='NOTIFY_RESPONSE_CODE')
print(access_token)
# N6g50DiQZk5Xh...25FoFzrs2npkU3z
Get Status
status = client.status(access_token='YOUR_ACCESS_TOKEN')
print(status)
# {'status': 200, 'message': 'ok', 'targetType': 'USER', 'target': 'NiJia Lin'}
Send message
response = client.send(access_token='YOUR_ACCESS_TOKEN', params={
'message': 'This is notify message'
})
print(response)
# {'status': 200, 'message': 'ok'}
Send message with Sticker
You can find stickerId and stickerPackageId here
# push message with sticker or image
response = client.send(access_token='YOUR_ACCESS_TOKEN', message='This is notify message')
print(response)
# {'status': 200, 'message': 'ok'}
Send message with Image path
from lotify.client import Client
client = Client()
image = client.send_message_with_image_path(
access_token='YOUR_ACCESS_TOKEN',
message='This is notify message',
image_path='./test_image.png'
)
print(image)
# {'status': 200, 'message': 'ok'}
Send message with Image url
from lotify.client import Client
client = Client()
image = client.send_message_with_image_url(
access_token='YOUR_ACCESS_TOKEN',
message='This is notify message',
image_thumbnail='https://i.imgur.com/RhvwZVm.png',
image_fullsize='https://i.imgur.com/RhvwZVm.png',
)
print(image)
# {'status': 200, 'message': 'ok'}
Revoke access token
```python client = Client() revoke = client.revoke(access_token=‘YOUR_ACCESS_TOKEN’) print(revoke) # {‘status’: 200, ’message
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lotify-1.1.1.tar.gz
(7.2 kB
view details)
File details
Details for the file lotify-1.1.1.tar.gz
.
File metadata
- Download URL: lotify-1.1.1.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5648ce39b99a07c65d6e63e741e9a6edd583dff56f441d07443f67b9bd59c3d7 |
|
MD5 | 9e5db76c5f5f090cd18a65a678d01b99 |
|
BLAKE2b-256 | 73c18e77df821d6f00cdecd66f0637c326064c973150b7744016fdd3ec55d560 |