using the wrong property name 😭
This commit is contained in:
parent
655633349c
commit
7f2f2decc4
1 changed files with 6 additions and 6 deletions
12
index.ts
12
index.ts
|
@ -30,14 +30,14 @@ const eligibilityCmd = async (ctx: any) => {
|
||||||
redirect: "follow"
|
redirect: "follow"
|
||||||
}).then(res => res.json())
|
}).then(res => res.json())
|
||||||
|
|
||||||
if (res.status === "not_found")
|
if (res.result === "not_found")
|
||||||
return await ctx.respond({
|
return await ctx.respond({
|
||||||
response_type: 'ephemeral',
|
response_type: 'ephemeral',
|
||||||
text: `${matchedBy !== "user mention" ? "You aren't" : `<@${userId}> isn't`} verified. ${matchedBy !== "user mention" ? `\nCheck out the <https://identity.hackclub.com/onboarding/welcome}|identity vault> to verify.` : ""}`,
|
text: `${matchedBy !== "user mention" ? "You aren't" : `<@${userId}> isn't`} verified. ${matchedBy !== "user mention" ? `\nCheck out the <https://identity.hackclub.com/onboarding/welcome}|identity vault> to verify.` : ""}`,
|
||||||
unfurl_links: true
|
unfurl_links: true
|
||||||
})
|
})
|
||||||
|
|
||||||
else if (res.status === "needs_submission") {
|
else if (res.result === "needs_submission") {
|
||||||
return await ctx.respond({
|
return await ctx.respond({
|
||||||
response_type: 'ephemeral',
|
response_type: 'ephemeral',
|
||||||
text: `${matchedBy !== "user mention" ? "You" : `<@${userId}>`} provided insufficient evidence of who ${matchedBy !== "user mention" ? "you" : "they"} are.${matchedBy !== "user mention" ? `\nCheck out the <https://identity.hackclub.com/onboarding/welcome}|identity vault> to re-verify.` : ""}`,
|
text: `${matchedBy !== "user mention" ? "You" : `<@${userId}>`} provided insufficient evidence of who ${matchedBy !== "user mention" ? "you" : "they"} are.${matchedBy !== "user mention" ? `\nCheck out the <https://identity.hackclub.com/onboarding/welcome}|identity vault> to re-verify.` : ""}`,
|
||||||
|
@ -45,14 +45,14 @@ const eligibilityCmd = async (ctx: any) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (res.status === "pending") {
|
else if (res.result === "pending") {
|
||||||
return await ctx.respond({
|
return await ctx.respond({
|
||||||
response_type: 'ephemeral',
|
response_type: 'ephemeral',
|
||||||
text: `${matchedBy !== "user mention" ? "Your verification" : `<@${userId}>'s verification`} has not been accepted yet.`,
|
text: `${matchedBy !== "user mention" ? "Your verification" : `<@${userId}>'s verification`} has not been accepted yet.`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (res.status === "rejected") {
|
else if (res.result === "rejected") {
|
||||||
if (matchedBy === "user mention") {
|
if (matchedBy === "user mention") {
|
||||||
return await ctx.respond({
|
return await ctx.respond({
|
||||||
response_type: 'ephemeral',
|
response_type: 'ephemeral',
|
||||||
|
@ -85,14 +85,14 @@ const eligibilityCmd = async (ctx: any) => {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
else if (res.status === "verified_eligible") {
|
else if (res.result === "verified_eligible") {
|
||||||
return await ctx.respond({
|
return await ctx.respond({
|
||||||
response_type: 'ephemeral',
|
response_type: 'ephemeral',
|
||||||
text: `${matchedBy !== "user mention" ? "You have verified your" : `<@${userId}> has verified their`} identity, and ${matchedBy !== "user mention" ? "are" : "is"} eligible for YSWS prizes.`,
|
text: `${matchedBy !== "user mention" ? "You have verified your" : `<@${userId}> has verified their`} identity, and ${matchedBy !== "user mention" ? "are" : "is"} eligible for YSWS prizes.`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (res.status === "verified_but_over_18") {
|
else if (res.result === "verified_but_over_18") {
|
||||||
return await ctx.respond({
|
return await ctx.respond({
|
||||||
response_type: 'ephemeral',
|
response_type: 'ephemeral',
|
||||||
text: `${matchedBy !== "user mention" ? "You have verified your" : `<@${userId}> has verified their`} identity, but since ${matchedBy !== "user mention" ? "you're" : "they're"} over 18, ${matchedBy !== "user mention" ? "you're" : "they're"} ineligible for YSWS prizes.`,
|
text: `${matchedBy !== "user mention" ? "You have verified your" : `<@${userId}> has verified their`} identity, but since ${matchedBy !== "user mention" ? "you're" : "they're"} over 18, ${matchedBy !== "user mention" ? "you're" : "they're"} ineligible for YSWS prizes.`,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue