https://github.com/tsubasaogawa/linebot-publisher-layer
The simplest message post module to LINE Bot. It works on AWS Lambda Layer.
https://github.com/tsubasaogawa/linebot-publisher-layer
Last synced: 3 months ago
JSON representation
The simplest message post module to LINE Bot. It works on AWS Lambda Layer.
- Host: GitHub
- URL: https://github.com/tsubasaogawa/linebot-publisher-layer
- Owner: tsubasaogawa
- Created: 2019-04-07T14:24:56.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T03:02:05.000Z (over 2 years ago)
- Last Synced: 2025-03-02T22:02:18.159Z (4 months ago)
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# linebot-publisher-layer
The simplest message post module to LINE Bot.
It works on AWS Lambda Layer.## Example
Set `LINE_BOT_ACCESS_TOKEN` environment variable in advance.
```python
# import module
import linebot_publisher# create instance
publisher = linebot_publisher.LineBotPublisher()# post
publisher.post_text(
'xxx', # LINEBOT_TO_ID
'test message'
)
```### Image of post

## Required environment variables
### LINEBOT_ACCESS_TOKEN
Access token
## Methods
### LineBotPublisher(access_token=ACCESS_TOKEN, endpoint=ENDPOINT)
- Constructor.
- If `access_token` is not given, module obtains from environment variable named `LINE_BOT_ACCESS_TOKEN`.
- `endpoint` is defined as 'https://api.line.me/v2/bot/message/push' in module.### post_text(to_id, text, notifies=True)
- Post a LINE message with `text` to `to_id`.
- `to_id` is <userId>, <roomId> or <groupId>.
- It does not notify user(s) when posts if `notifies` is False.
- It returns `Response` object with status code 200.