python - 如何从电报会话中保存数据 - django
问题描述
我有一个电报机器人,它发送一个链接让用户使用 twitch 进行身份验证,显然,当 twitch 发送响应时,我只提供了有关登录的 twitch 用户的信息,我如何才能获得点击链接的电报用户是谁等信息? 我在这里问了一个类似的问题,但现在我意识到我不明白该怎么做(无论如何我收到的答案可能对你更有用)。
视图.py
@csrf_exempt
def telegramBot(request): #function that handles telegram messages
return telegramBotFunction(request) #return a http response
#the user is redirected here after login with twitch, how can i get the telegram id?
def verify(request):
return gestioneVerificaAuth(request) #return HttpResponse("<h2> Twitch user is subscribed/or not to streamer X <h2>)
编辑:更新了代码
解决方案
推荐阅读
- swift - 使用元数据将应用程序对象链接到磁盘上的文件
- amazon-web-services - AWS 用户管理上的 Kibana:创建了新用户,但看不到我的索引模式
- javascript - 异步 JavaScript 执行顺序?
- python-3.x - 创建新标签(ttk笔记本)时如何保留小部件?
- java - 使用 Hibernate 5.1 和 Spring 5.2.9 保存实体无法保存实体(spring-boot 2.3.4,spring-boot-devtools)
- ssl - 无法连接到主机 www.reddit.com:443 ssl:True
- css - 在 Safari 中使用 SVG 标识符会导致问题
- python - 如何保持点击自动点击器?
- git - 将请求从开发拉到主控,如何保持分支“均匀/同步”
- c++ - C ++没有构造函数实例与参数列表匹配