A user, nekodroid, requests an API feature to retrieve additional information about external accounts, specifically Discord IDs linked to Discourse accounts, to sync roles between a Discord server and the forum. pfaffman points out that the necessary data is already accessible via the API, suggesting it could be stored in a custom field, and references a guide on reverse-engineering the API. Stephen suggests searching the meta forum, where nekodroid confirms they had previously searched but found the solution unsuitable due to API spam and functionality issues. nekodroid clarifies the desired functionality: a !check command that verifies if a Discord user’s ID is linked to a Discourse account and assigns a role accordingly.
I’ve looked into Discourse’s API, and was wondering if additional info about external accounts (from other social networks) could be get through it.
In my case, it’d be for Discord : I’d like to sync people that create their account on the forum with a role on my server. On a command the user would type, the Discord bot would check if a Discourse account does have the user’s Discord account linked to it using its ID. (Might have been a bit hard to understand sorry '^^)
I’ll give it a try and keep you all up-to-date here. —
EDIT : I had tried this already. It spams the Discord API and almost got my original bot banned last time — Can’t use this. I’d rather make use of the Discourse API myself, and get IDs easily. Plus, it’s not working the way I want it to work.
What I’d basically like to have is a !check command. When the user runs it, it checks the Discord user’s ID and on the site if an account with the same ID exists. If it does, it gives a role. If not, it doesn’t.