从 DISCORD API INVITES 请求信息
Posted
技术标签:
【中文标题】从 DISCORD API INVITES 请求信息【英文标题】:Requesting info out of DISCORD API INVITES 【发布时间】:2021-06-05 22:07:36 【问题描述】:我想知道如何从https://discord.com/api/v8/invites/ 请求这两个值,获取第一个频道的名称和公会的名称。 因为我期待这样做,所以在频道中发送的每个邀请都必须在它来自的公会名称中包含一个特定的单词,并且一个特定的单词作为第一个频道,否则它将被删除。 我会很感激一些帮助,因为我对这个文档很陌生,所以我真的很困惑。谢谢!
【问题讨论】:
【参考方案1】:如果您尝试使用 API,(本示例使用 unblock)
您会收到以下回复:
"code": "unblock",
"guild":
"id": "419123358698045453",
"name": "TitaniumNetwork",
"splash": "86378b9059a3fe6d7a76d126c3c4b678",
"banner": "86378b9059a3fe6d7a76d126c3c4b678",
"description": null,
"icon": "870e49b4cd8fce8063b7bda48e33aa46",
"features": ["COMMUNITY", "WELCOME_SCREEN_ENABLED", "VANITY_URL", "ANIMATED_ICON", "BANNER", "PREVIEW_ENABLED", "INVITE_SPLASH", "MEMBER_VERIFICATION_GATE_ENABLED", "NEWS"],
"verification_level": 4,
"vanity_url_code": "unblock",
"welcome_screen":
"description": "We are an organization revolving around proxies, armed with a mission for the protection of freedom and privacy rights to be normalized.",
"welcome_channels": [
"channel_id": "738967801460686889",
"description": "Read the rules.",
"emoji_id": "709447784536866869",
"emoji_name": "verif"
,
"channel_id": "796606512407511060",
"description": "Join some discussions!",
"emoji_id": "766746158546026547",
"emoji_name": "infernal"
,
"channel_id": "743646448721068092",
"description": "Talk about tech!",
"emoji_id": "779561163293196288",
"emoji_name": "abraded"
,
"channel_id": "769716455230668820",
"description": "Be ready for feedback!",
"emoji_id": "574816517989072897",
"emoji_name": "TitaniumNetwork"
]
,
"channel":
"id": "738967801460686889",
"name": "rules",
"type": 0
解析 JSON 很简单。
【讨论】:
问题是我怎么能返回那个?例如,你能告诉我如何从discord.com/api/v8/invites/xcunxAsRu5 中获取公会名称吗? 在这种情况下,它将是 response.guild.name以上是关于从 DISCORD API INVITES 请求信息的主要内容,如果未能解决你的问题,请参考以下文章
如何在 discord.js 中获取不和谐服务器的名称和图片
如何使用 Discord API 和 Python 请求发送图片