Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/louis70109/line-icon-switch-python
LINE Icon Switch sample code
https://github.com/louis70109/line-icon-switch-python
aws flask icon-switch line python serverless
Last synced: 23 days ago
JSON representation
LINE Icon Switch sample code
- Host: GitHub
- URL: https://github.com/louis70109/line-icon-switch-python
- Owner: louis70109
- License: mit
- Created: 2020-03-27T17:54:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T17:17:28.000Z (almost 2 years ago)
- Last Synced: 2023-03-04T11:40:14.229Z (over 1 year ago)
- Topics: aws, flask, icon-switch, line, python, serverless
- Language: Python
- Homepage:
- Size: 88.9 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# LINE Icon Switch API sample
LINE new API - [Icon Switch](https://developers.line.biz/zh-hant/reference/messaging-api/#icon-nickname-switch): this API can change icon and display name in same **LINE BOT**
# Trigger text
This bot will catch trigger text to change name and avatar !!🎉
- Sally
- Brown
- Cony![](https://i.imgur.com/TbtdNFjl.png)
# Developer Side
## LINE account
- Got A LINE Bot API devloper account
Make sure you already registered, if you need use LINE Bot.- Go to LINE Developer Console
- Close auto-reply setting on "Messaging API" Tab.
- Setup your basic account information. Here is some info you will need to know.
- Callback URL: `https://{NGROK_URL}/webhooks/line`
- Verify your webhook.
- You will get following info, need fill back to `.env` file.
- Channel Secret
- Channel Access Token (You need to issue one here)## Normal testing
1. first terminal window
```
cp .env.sample .env
pip install -r requirements.txt --user
python api.py
```> [2020/03/28] LINE just not already release tag in SDK, so I use git method to install NEW feature package(icon switch).
2. Create a provisional Https:```
ngrok http 5000
```or maybe you have npm enviroment:
```
npx ngrok http 5000
```
![](https://i.imgur.com/azVdG8j.png)3. Copy url to LINE Developer Console
## If you have AWS account
1. Install serverless via npm:```bash=
$ npm install -g serverless
```2. Setup your **AWS** ceritficate
```bash=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
```3. Deploy the example:
```bash=
npm install
pip install -r requirements.txt --user
serverless wsgi serve # local testing
serverless deploy # deploy to AWS
```4. If deploy, copy the url to LINE Developer Console
# LicenseMIT License