Telegram Bot with Azure-(1) BOT SERVICE

Telegram Part

Yvshih
Yvshih
Aug 8, 2017 · 3 min read

首先,我們得先透過BotFather(@botfather)建立一個Telegram Bot Account。

依照BotFather的步驟建立。
然後就可以拿到API token
測試token: https://api.telegram.org/bot{TOKEN}/getMe

Azure Part

到Azure Portal訂閱 Bot Service,填寫好基本資料即可。

點選" Create Microsoft App ID and password",就可以產生一組APP ID,和密碼。將產生的這組識別碼填入。

注意: 此密碼只會出現一次,需妥善保存。

選擇語言和模板即可。

模板: 依據想要實作的bot功能有異,如果希望只有基本echo效果就可以選echo。因為我想套用Azure Cortana所以我選擇Language understanding。

如果跟我一樣使用Language understanding Template的,需要給LUIS存取權限。

邏輯判斷在index.js,可以從Azure Test Platform檢視結果。

那怎麼把Bot 跟 Telegram接起來呢?

其實只要把游標移到CHANNELS,然後將telegram拿到的bot token填入。

就大功告成了。

BOT Service是一個簡化聊天機器人的開發服務,相較於以前要自己架Server更直覺。

Yvshih

Written by

Yvshih

見,微,知著

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade