Skip to content

Theory of Computation class final project 2017 (Create a telegram bot using py)

License

Notifications You must be signed in to change notification settings

angelinahung/TOC-Project-2017

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOC Project 2017

A telegram bot based on a finite state machine.

In this final project, I can communicate with my telegram chatbot.

Setup

Prerequisite

  • Python 3

Install Dependency

pip install -r requirements.txt

Secret Data

API_TOKEN and WEBHOOK_URL in app.py 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.

ngrok would be used in the following instruction

ngrok http 5000

After that, ngrok would generate a https URL.

You should set WEBHOOK_URL (in app.py) to your-https-URL/hook.

Run my chatbot

python3 app.py

Finite State Machine

fsm

Usage

The initial state is set to user.

Every time user state is triggered to advance to another state, it will go_back to user state after the bot replies corresponding message.

In this project, there are there usage of my chatbot: To list hotels in Tainan, movie theater timetable and Tainan one day tour.

Descriptions

First, I need to choose one of three options to ask my chatbot.

My options:

  1. Hotels
  2. Movie theater
  3. Tainan sights

After the chatbot reply the message, you can ask next further questions related to your option.

Here, I described the input scheme:

  1. Hotels

    1. Top 5 review

      • price
      • location
    2. Top 5 price

      • review
      • location
    3. Top 5 near ncku

      • review
      • price
  2. Movie theater

    1. Guopin
      • Now trending
    2. Viewshow
      • Now trending
  3. Tainan Sights

    • One day tour
      • Dine

And the chatbot will reply the answer of the above input strings one by one.

*(P.S. It's not efficient to write it all the answer here)*

Author

Angelina Anggara

About

Theory of Computation class final project 2017 (Create a telegram bot using py)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages