IM: October 2015 Archives

Telegram

user-pic
Vote 0 Votes

Telegram 這一套即時通訊軟體, 在台灣似乎很少人知道, 用的人更少.
它的 Client 端是 Open Source, Server 端是私有軟體,
Client 端可以多重登入, 訊息也同步, 比 LINE 強, 只是功能沒那麼多, 介面比較簡單一點.
有各種平台的 Apps, 最棒的是有提供 API
他的 API 有兩種, Bot API 及 Telegram API , 若只是要發訊息用第一種即可.

Bot API 使用摘要:
在 Search 輸入 BotFather, 加入他, 跟他對話, 輸入 /newbot
他會問你 Bot name 及 Bot username, 然後會給你一組 token, 可用來發訊息
API 網址 https://api.telegram.org/bot<token>/METHOD_NAME
支援 GET, POST
METHOD_NAME 在這一頁都有說明
傳訊息需要取得 chat_id
如何取得 chat_id ? 收訊者要先傳個訊息給 Bot, 然後用 getUpdates METHOD 取得
https://api.telegram.org/bot<token>/getUpdates
送訊息 https://api.telegram.org/bot<token>/sendMessage?chat_id=1234&text=test
若是群組的話, 要先將 Bot 加入群組, 再送個訊息,
一樣用 getUpdates 取得群組的 chat_id, 群組的 chat_id 好像是負數
sendMessage 時改成群組 chat_id, 就可以送訊息到群組

表情符號碼
telegram.emoji module

Recent Entries

About this Archive

This page is an archive of entries in the IM category from October 2015.

IM: April 2013 is the previous archive.

IM: November 2015 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Monthly Archives