add comments

This commit is contained in:
Bram Hagens 2024-04-08 00:19:32 +02:00
parent fff5ce4aca
commit 758255f652
No known key found for this signature in database
GPG key ID: CEF9728B2127ECDC

View file

@ -49,6 +49,8 @@ export function processURI (uri) {
uriRegularExpression: reURI.toString(), uriRegularExpression: reURI.toString(),
uriIsAmbiguous: false 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: { proof: {
request: { request: {
uri: `https://discord.com/api/v10/invites/${match[1]}`, uri: `https://discord.com/api/v10/invites/${match[1]}`,
@ -82,6 +84,7 @@ export function processURI (uri) {
export const functions = { export const functions = {
postprocess: async (claimData, proofData, opts) => { 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 claimData.profile.display = proofData.result.inviter.username
return { claimData, proofData } return { claimData, proofData }