我在很多不和諧的群聊中,我需要為我正在制作的測驗工具抓取他們的 ID。
我如何抓取我所在的每個群聊的這個 ID?
uj5u.com熱心網友回復:
你可以使用discord api來抓取id,因為你標記了python,我想你想要python中的代碼。要訪問 api,您需要為您的帳戶提供授權令牌,您可以搜索如何獲取該令牌,無論如何這將是一種獲取 dms 的可行方法
channelIds = requests.get("https://discord.com/api/v9/users/@me/channels",
headers={"Authorization": "discord_token_here"}).json()
for channel in channelIds:
print(channel['id']) #or do whatever you want with the id's
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/361642.html
