通过机器人帐户获取用户个人资料连接 [英] Getting User profile connections with a bot account

查看:142
本文介绍了通过机器人帐户获取用户个人资料连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试向Discord机器人添加功能:当我的Twitch帐户获得新的关注者时,并且如果关注者的Twitch帐户已与他的Discord帐户相关联,则当他进入我的服务器时,他会自动获得新角色

I'm trying to add a feature to my Discord bot: when my Twitch account gets a new follower, and if the follower's Twitch account is linked to his Discord account, when he gets into my server he's getting automatically a new role.

所以我的问题是:我可以获取用户的Discord链接的应用程序,并获取链接到这些应用程序的用户ID吗?
像获取新关注者的Twitch的用户ID并将其与使用Discord.js与我的频道的用户的Discord链接的Twitch用户ID进行比较?

So my question is: can I get the Discord's linked apps of a user, and get the user ID linked to those apps?
Like getting the Twitch's user ID of the new follower and compare it with with the Discord's linked Twitch user ID of the users of my channel using Discord.js?

推荐答案

目前,API不允许从机器人帐户获取配置文件(及其连接). discord.js库具有执行此操作的方法( User.fetchProfile() ),但仅适用于自动机器人(Discord会禁止您使用它们).

At the moment, the API doesn't allow fetching the profile (and so its connections) from a bot account. The discord.js library has a method to do this (User.fetchProfile()), but it will only work on self-bots (Discord can ban you for using them).

Discord Dream Land在此主题上有一个活跃的想法:

Discord Dream Land has an active idea on this topic: link

这篇关于通过机器人帐户获取用户个人资料连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆