Skip to content

Commit

Permalink
update shortlink success message
Browse files Browse the repository at this point in the history
resolves #10
  • Loading branch information
EthanThatOneKid committed Nov 1, 2024
1 parent b17a349 commit e4fb9b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ export async function main() {
Duration.fromString(interaction.data.parsedOptions.ttl);

// Compose the commit message.
const shortlinkText = `acmcsuf.com/${shorterOptions.data.alias}`;
const commitText = result.sha.slice(0, 7);
const commitURL = `https://acmcsuf.com/code/commit/${result.sha}`;
let content =
`Created commit [${result.message}](https://acmcsuf.com/code/commit/${result.sha})!`;
`Created shortlink [${shortlinkText}](https://${shortlinkText}) in commit [\`${commitText}\`](${commitURL})!`;
if (ttlDuration) {
// Render to Discord timestamp format.
// https://gist.github.com/LeviSnoot/d9147767abeef2f770e9ddcd91eb85aa
Expand Down Expand Up @@ -194,7 +197,8 @@ export async function main() {
}

if (
!interaction.member.roles.some((role) => DISCORD_ROLE_ID === role)
!interaction.member.roles
.some((role) => DISCORD_ROLE_ID.includes(role))
) {
return {
type: InteractionResponseType.ChannelMessageWithSource,
Expand Down

0 comments on commit e4fb9b0

Please sign in to comment.