Skip to content

Commit

Permalink
Merge pull request #37 from Dougley/master
Browse files Browse the repository at this point in the history
  • Loading branch information
sylveon authored Aug 30, 2021
2 parents d739fa2 + 2386d24 commit fc4cc5e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ dist

# TernJS port file
.tern-port

# Local Netlify folder
.netlify
2 changes: 1 addition & 1 deletion func/helpers/discord-helpers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const API_ENDPOINT = "https://discord.com/api/v6";
const API_ENDPOINT = "https://discord.com/api/v9";
const MAX_EMBED_FIELD_CHARS = 1024;
const MAX_EMBED_FOOTER_CHARS = 2048;

Expand Down
12 changes: 10 additions & 2 deletions func/submission-created.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@ exports.handler = async function (event, context) {
userId: userInfo.id
};

message.embed.description = `[Approve appeal and unban user](${unbanUrl.toString()}?token=${encodeURIComponent(createJwt(unbanInfo))})`;
message.components = [{
type: 1,
components: [{
type: 2,
style: 5,
label: "Approve appeal and unban user",
url: `${unbanUrl.toString()}?token=${encodeURIComponent(createJwt(unbanInfo))}`
}]
}];
}
}

Expand All @@ -110,7 +118,7 @@ exports.handler = async function (event, context) {
};
}
} else {
console.log(await result.json());
console.log(JSON.stringify(await result.json()));
throw new Error("Failed to submit message");
}
}
Expand Down

0 comments on commit fc4cc5e

Please sign in to comment.