与服务器授权的不一致机器人程序(标头)

2024-09-28 05:26:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试对我的bot进行身份验证,并将有关bot的信息发布到列出它们的服务器上。api声明,我必须首先通过发送bot的身份验证令牌来向他们的服务器进行身份验证。我总算搞定了。但是,当我试图将信息发布到指定的URL时,我甚至没有收到响应代码。在

async def apiPost():
    servers = list(client.servers)
    numServers = len(client.servers)    

    URL = "https://www.discordbotlist.com"

    URL2 = "https://www.discordbotlist.com/api/bots/:botIDOmitted/stats"

    servdata = {'guilds':int(numServers)}

    authorization = {'Authorization':'Bot realTokenOmitted'}

    r=requests.get(URL,headers=authorization)
    print(r)
    r=requests.post(URL2, data=servdata)
    print(r)

我不太清楚我在这一点上做错了什么。在


Tags: httpscomclient身份验证api信息urlwww

热门问题