python - 电报机器人-getChat-invite_link
问题描述
我在 python 中有一个非常简单的机器人来运行这段代码:
def get_chat(chat_id=None):
data = {
'chat_id': str(chat_id)
}
resp = urllib2.urlopen(BASE_URL + 'getChat?'+urllib.urlencode(data)).read()
return resp
我的机器人是聊天管理员
它应该像这里所说的那样接收对象聊天https://core.telegram.org/bots/api#getchat以及对象内部的聊天链接,但我唯一能收到的是:
{"ok":true,"result":{"id":#####,"title":"####","type":"supergroup"}}
为什么?
解决方案
https://core.telegram.org/bots/api#chat
邀请链接:字符串,可选。聊天邀请链接,用于群组、超级群组和频道聊天。聊天中的每个管理员都会生成自己的邀请链接,因此机器人必须首先使用 exportChatInviteLink 生成链接。仅在 getChat 中返回。
推荐阅读
- c++ - 为什么指针不存储和打印与它应该匹配的对象相同的数据?(C++)
- php - 如何通过ID删除数据库中的数据
- python - 如何使判断碰撞的代码成为乌龟和矩形
- python - 如何拧进度条来复制文件
- performance - 如果列表计数大于 1M,则 Schwartzian 变换不会明显更快
- javascript - JavaScript 中如何实现“数组”?
- javascript - 循环仅将最后一个元素添加到数组中
- java - 获取范围内的 Firebase 文档
- django - 将测试渲染为模板:{% static %} 不起作用
- grails - Spring security UI grails插件用户注册错误