如何获得正确的电报频道ID?

Sky*_*kyN 11 telegram

  • 如果我得到user_id,通过contacts.resolveUsername#bf0131c字符串搜索channel,然后我得到user_id = 0x0827ac18

如果发送给messages.getFullChat#3b831c66,则收到错误PEER_ID_INVALID.

如果发送if users.getFullUser#ca30a5b1,那么我得到错误USER_ID_INVALID.

  • 如果我搜索字符串channel使用contacts.search#11f812d8,然后我得到两个用户使用用户名ChannelBotChannel_Bot,但与用户或频道名没有得到channel.

  1. 如何获取使用的频道ID messages.getFullChat#3b831c66
  2. 怎么得到chat_id名字?

Sed*_*rei 12

只需简单地将信息从您的频道转发到此机器人:(https://telegram.me/getidsbot)


njh*_*jha 9

如何获取私人频道的chat_id:

将其公开,通过您的bot API或cURL向此频道发送@ChannelName发送消息

https://api.telegram.org/bot111:222/sendMessage?chat_id=@channelName&text=123

它将返回频道ID!

{ "ok" : true, "result" : { "chat" : { "id" : -?????????, "title" : "Test Private Channel", "type" : "channel" }, "date" : X, "message_id" : 7, "text" : "XXXXXX" } }
Run Code Online (Sandbox Code Playgroud)

现在您可以将频道转换为私人频道并使用chat_id!