Is there any way to find a Patreon patron’s Discord UserID? I’d like to replicate the Patreeon Bot’s role assign function, without having to use their bot…
According to API Reference,
To be able to get your patrons’ Discord user ids via the API, you must connect Patreon’s Discord integration at your page at patreon.com and add it as a benefit to the tier(s) for which you will ask the Discord ids from the API. You can use your own Discord bot along Patreon’s Discord integration.
For more information, see Paging through a list of pledges.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
Sorry for not getting back to you earlier, other things came up.
The Patreon bot already requires that, so the Discord Integration is set up.
And if I manually download the patrons information in CSV, I can see the Discord IDs for active subs.
But the Patreon module does NOT list that information in any of the functions:
- Get a Member
- Get Campaign Members
So I am kinda stumped how to get that data, as I’d expect that when a Patreon plugin exists, I’d not have to attempt scripting their API to maybe get the desired data?
EDIT:
I’ve found that the Patreon WebHooks should contain that data, but there’s no way of testing (as far as I could find) without actually waiting for someone to add/change/delete their pledge…
In that case you’ll need to request for this information to be added to those modules.
I ended up building my own ‘integration’ from scratch, because the JSON parser built into the Patreon module as well as the standard JSON parser ignore parts of the output when the JSON repeats the same data (the callback from Patreon on a change can contain up to 4 sections with identical structures ([included]>[attributes]) in them, and Make’s JSON only sees the first time they occur, without giving me access to the fields in the 2nd~4th iterations of the same…
It’s very likely Patreon is to blame here, but that doesn’t help me.
I opened a ticket to get it fixed, but my custom ‘integration’ using the standard webhook will do exactly what I want…
In the end it it still a fairly compact scenario, despite having to kludge around with text parser and array aggregation…
- Webhook, pass JSON as string
- TP (1), grab Discord UserID
- TP (1), grab all entitled tiers
- Put tiers (3) in Array
- Build an array with all Tiers and their matching DIscord role IDs
- Iterate through the Tiers array (5)
- router
filter: If Tier name (5/6) is in Entitled Tiers Array (4): - Add role ID (5/6) to User ID (2)
filter: If Tier name (5/6) is NOT in Entitled Tiers Array (4): - Remove role ID (5/6) from User ID (2)