Skip to content

Bot for searching crypto coin, and it can show the following items Real-time price ,different time unit changing price and Metadata. And also support multiple users using at the same time

Notifications You must be signed in to change notification settings

ty0601/Crypto-Coin-Line-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crypto Coin Line Bot

  • data from Coin Market Cap

Introduction

Bot for searching crypto coin, it can show the following items

  • Real-time price
  • 1hr, 24hr, 7d, 30d changing price
  • Metadata
  • Support multiple users using at the same time

Usage

Enter 'menu' to start the bot
  • menu
Enter 'introduction' or press the introduction button
  • introduction
Enter 'fsm' or press the introduction button
  • fsm
In fsm graph, you can press the image to the image website
Enter 'crypto coins' or press the introduction button to choose coins
  • choose_coin
Enter 'price' or press the introduction button to get price detail
  • price
Enter 'metadata' or press the introduction button to get metadata
  • price

Setup

Prerequisite

  • Python 3.6
  • Pipenv
  • Facebook Page and App
  • HTTPS Server

Install Dependency

pip3 install pipenv

pipenv --three

pipenv install

pipenv shell

Secret Data

You should generate a .env file to set Environment Variables refer to our .env.sample. LINE_CHANNEL_SECRET and LINE_CHANNEL_ACCESS_TOKEN MUST be set to proper values. Otherwise, you might not be able to run your code.

Run Locally

You can either setup https server or using ngrok as a proxy.

a. Ngrok installation

or you can use Homebrew (MAC)

brew cask install ngrok

ngrok would be used in the following instruction

ngrok http 8000

After that, ngrok would generate a https URL.

Run the sever

python3 app.py

b. Servo

Or You can use servo to expose local servers to the internet.

Finite State Machine

fsm

Deploy

Setting to deploy webhooks on Heroku.

Heroku CLI installation

or you can use Homebrew (MAC)

brew tap heroku/brew && brew install heroku

or you can use Snap (Ubuntu 16+)

sudo snap install --classic heroku

Connect to Heroku

  1. Register Heroku: https://signup.heroku.com

  2. Create Heroku project from website

  3. CLI Login

    heroku login

Upload project to Heroku

  1. Add local project to Heroku project

    heroku git:remote -a {HEROKU_APP_NAME}

  2. Upload project

    git add .
    git commit -m "Add code"
    git push -f heroku master
    
  3. Set Environment - Line Messaging API Secret Keys

    heroku config:set LINE_CHANNEL_SECRET=your_line_channel_secret
    heroku config:set LINE_CHANNEL_ACCESS_TOKEN=your_line_channel_access_token
    
  4. Your Project is now running on Heroku!

    url: {HEROKU_APP_NAME}.herokuapp.com/callback

    debug command: heroku logs --tail --app {HEROKU_APP_NAME}

  5. If fail with pygraphviz install errors

    run commands below can solve the problems

    heroku buildpacks:set heroku/python
    heroku buildpacks:add --index 1 heroku-community/apt
    

    refference: https://hackmd.io/@ccw/B1Xw7E8kN?type=view#Q2-如何在-Heroku-使用-pygraphviz

Reference

Pipenv ❤️ @chihsuan

TOC-Project-2019 ❤️ @winonecheng

Flask Architecture ❤️ @Sirius207

Line line-bot-sdk-python

About

Bot for searching crypto coin, and it can show the following items Real-time price ,different time unit changing price and Metadata. And also support multiple users using at the same time

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages