【发布时间】:2022-09-30 08:20:29
【问题描述】:
我想调查我个人所属的不和谐,但我没有成为会员的机器人。我想找出每个不和谐的大小或近似大小。目前我无法访问不和谐或不和谐的预览。
应该是可能的; discord 文档 (https://discord.com/developers/docs/resources/guild#get-guild-preview) 说,即使用户(可能是机器人)不是成员,也至少可以获得预览:
获取公会预览 GET/guilds/{guild.id}/preview 返回公会 给定 id 的预览对象。如果用户不在公会中,则 公会必须是潜伏的(它必须是可发现的或有生命的 公共舞台)。
我正在尝试的python代码是:
import requests url_str =\"https://discordapp.com/api/guilds/\" + str(guild_id) + \'/preview\' print(url_str) response = requests.get(url= url_str,headers={ \'Authorization\':\'Bot \' + bot_token}) print(response) url_str =\"https://discordapp.com/api/guilds/\" + str(guild_id) print(url_str) response = requests.get(url= url_str,headers={ \'Authorization\':\'Bot \' + bot_token}) print(response)输出是:
https://discordapp.com/api/guilds/{guild_id}/preview <响应 [404]> https://discordapp.com/api/guilds/{guild_id} <响应 [403]>
我正在尝试做的事情可能吗?如果是这样,出了什么问题?
标签: discord