首页 > 解决方案 > 如何从电报会话中保存数据 - 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>)

编辑:更新了代码

标签: pythondjangosessiontelegramtwitch

解决方案


推荐阅读