如果我得到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
,则会得到用户名为ChannelBot
和Channel_Bot
的两个用户,而不是用户名或通道名为channel
.的get
messages.getFullChat#3b831c66
chat_id
by name?发布于 2017-08-08 20:37:10
只需将消息从您的通道转发到此机器人即可:(https://telegram.me/getidsbot)
发布于 2016-03-27 22:29:05
如何获取私有频道的chat_id:
将其公开,并通过您的机器人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" } }
现在您可以将通道转换为私有通道并使用chat_id!
发布于 2021-01-28 23:09:16
https://stackoverflow.com/questions/36099709
复制相似问题