loserking / line-icon-switch-python

LINE Icon Switch sample code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LINE Icon Switch API sample

LINE new API - Icon 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

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
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).

  1. Create a provisional Https:
ngrok http 5000

or maybe you have npm enviroment:

npx ngrok http 5000

  1. Copy url to LINE Developer Console

If you have AWS account

  1. Install serverless via npm:
$ npm install -g serverless
  1. Setup your AWS ceritficate
export AWS_ACCESS_KEY_ID=<your-key-here>
export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>
  1. Deploy the example:
npm install
pip install -r requirements.txt --user
serverless wsgi serve # local testing
serverless deploy     # deploy to AWS
  1. If deploy, copy the url to LINE Developer Console

License

MIT License

About

LINE Icon Switch sample code

License:MIT License


Languages

Language:Python 69.4%Language:HTML 30.6%