打造具備 NLP 功能的 Telegram Bot(上) 最近因為一些契機學了 Python 3,用它做了一個 Telegram Bot ( GitHub 連結 ),裡面用到 NLP Service,用上下兩篇文章記錄一下實作過程還有眉角。上篇首先教大家如何做一個最基本的回聲 Chatbot,接下來我們可以透過 NLP 服務,讓 Chatbot 根據使用者不同的訊息做回答,這樣就變成更加人性化的聊天機器人囉! 使用的工具及服務: Python 3 (for develop) pipenv (for dependency management) OLAMI (for NLP) ngrok (for testing) Step 1. Creating new bot Telegram 很有趣的地方在於,與其他通訊軟體(Line、Messenger)相比,開發者管理 Bot 的方式也是透過官方提供的一位 Bot 在處理的,它叫做 BotFather (眾 Bot 之父 XD)。如果已經有 Telegram 帳號,只要加 BotFather 為好友,就可以開始管理你的 Bot。 加入 BotFather 好友後,它會親切地問候,並告訴你他能為你提供什麼服務。 I can help you create and manage Telegram bots. If you're new to the Bot API, please see the manual ([https://core.telegram.org/bots](https://core.telegram.org/bots)). You can control me by sending these commands: /newbot - create a new bot /mybots - edit your bots [beta] /mygames - edit your games ([https://core.telegram.org/bots/games](https://core.telegram.org/bots/games)) [beta] Edit Bots /setname - change a bot's name /setdescr...