zaoldyeck / telegram-innovation-chatbot

Home Page:https://t.me/innovation_chatbot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telegram Innovation Chatbot

A Telegram Bot powered by OLAMI can understand Chinese. Has the ability to search music data due to integrating KKBOX Open API.
Try it out via https://t.me/innovation_chatbot

Articles

There are three articles talk about how to build this project.
(一)一步步打造 Telegram Bot
(二)為 Chatbot 增加 NLP 功能
(三)為 Chatbot 添加新技能

Development

  1. Ensure you have registered these accounts.
    1. Telegram
    2. OLAMI
    3. KKBOX Developers
    4. Heroku
  2. Create bot, get access token
    1. Talk to BotFather
    2. Type /newbot
  3. Create OLAMI App, get key and secret
    1. Log in OLAMI admin console
    2. 建立新應用 => fill information => 提交
    3. 變更設定 => 對話系統模組 => check all => 儲存設定
    4. Copy App key and App Secret
  4. Create KKBOX Developers App, get id and secret
    1. Log in KKBOX Developers
    2. My Apps => Create new app => fill information => submit
    3. Copy ID and Secret
  5. Clone this project, edit config.ini
    1. $ git clone https://github.com/zaoldyeck/telegram-innovation-chatbot.git
    2. Edit config.ini, fill in Telegram Bot ACCESS_TOKEN, OLAMI APP_KEY and APP_SECRET, KKBOX ID and SECRET
  6. Deploy program to Heroku
    1. Log in Heroku account
    2. New => create new app => fill information => Create app
    3. Install Heroku CLI
    4. In local terminal console
    $ cd telegram-innovation-chatbot
    $ git commit -m "Edit config.ini"
    $ heroku login
    $ heroku git:remote -a {your_heroku_app_name}
    $ git push heroku master
    
  7. Setting chatbot's webhook
    1. Get Heroku App url from App "Settings" page or "Open app". It should be https://{$your_heroku_app_name}.herokuapp.com/, then webhook url is https://{$your_heroku_app_name}.herokuapp.com/hook
    2. Open browser and enter https://api.telegram.org/bot{$telegram_access_token}/setWebhook?url={$webhook_url}

License

MIT License

Copyright (c) 2018 zaoldyeck

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

https://t.me/innovation_chatbot

License:MIT License


Languages

Language:Python 100.0%