diff --git a/src/serviceProviders/discord.js b/src/serviceProviders/discord.js index 0eec06a..fbc32d9 100644 --- a/src/serviceProviders/discord.js +++ b/src/serviceProviders/discord.js @@ -49,6 +49,8 @@ export function processURI (uri) { uriRegularExpression: reURI.toString(), uriIsAmbiguous: false }, + // Get proof from invites (https://discord.com/developers/docs/resources/invite#get-invite) + // See https://discord.com/developers/docs/reference#api-versioning for Discord's API versioning proof: { request: { uri: `https://discord.com/api/v10/invites/${match[1]}`, @@ -82,6 +84,7 @@ export function processURI (uri) { export const functions = { postprocess: async (claimData, proofData, opts) => { + // Extract inviter's username from https://discord.com/developers/docs/resources/invite#invite-object claimData.profile.display = proofData.result.inviter.username return { claimData, proofData }