Skip to content

Commit

Permalink
如何获取Telegram群组的ID
Browse files Browse the repository at this point in the history
  • Loading branch information
pppscn committed Mar 18, 2021
1 parent a8470fe commit eee3d65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@
* /token 获取apiToken,然后输入上面机器人的用户名
* 获得apiToken,格式参考:1234567890:ABCDEFGHIJKLMNOPQRSTUVWXYZ
* 复制 apiToken 到「设置Telegram机器人的ApiToken」一栏
* 获取自己的CahtID,粘贴到「设置被通知人的ChatId」一栏
* 跟自己的机器聊天,随便说点什么
* 获取自己(或群组)的CahtID,粘贴到「设置被通知人的ChatId」一栏
* 跟自己的机器人聊天,随便说点什么;或者创建一个群组,把机器人拉入群组,在群组里随便说点什么。
* 然后打开这个链接 `https://api.telegram.org/bot<apiToken>/getUpdates` 获取(PS.注意<apiToken>换成你自己的)
* ChatID 取值 result->message->chat->id (纯数字)
* ChatID 取值 result->message->chat->id (个人是纯数字;群组是负数,type:group;)
* 点击【测试】按钮验证一下

### 应用截图:
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/alert_dialog_setview_telegram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设置被通知人的ChatId" />
android:text="设置被通知人(或群组)的ChatId" />

<EditText
android:id="@+id/editTextTelegramChatId"
Expand Down

0 comments on commit eee3d65

Please sign in to comment.