Skip to content

Commit

Permalink
Improve /register output even more
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-8 committed Aug 4, 2024
1 parent eaeaea3 commit ee44665
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions api/src/discord/commands/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ async function getInvitationUrl(invitationCode: string | null = null) {
return `http${ssl}://${config.pad.domain}/#/auth/register/${invitationCode}`;
}

async function getProfileUrl() {
if (config.pad.domain == "") return null;

const ssl = config.pad.useSSL == "false" ? "" : "s";

return `http${ssl}://${config.pad.domain}/#/user/settings`;
}

async function createAccountLogic(
client: Client,
interaction: CommandInteraction
Expand Down Expand Up @@ -71,7 +79,7 @@ async function createAccountLogic(
}

await interaction.editReply({
content: `Your personal invitation url: ${invitationUrl}. If you already have a CTFNote account you should link it using the \`/link\` command instead.`,
content: `Your personal invitation url: ${invitationUrl}.\n-# If you already have a CTFNote account you should link it using the \`/link\` command using the Discord token from your profile: ${await getProfileUrl()}.`,
});
return;
}
Expand Down Expand Up @@ -105,7 +113,7 @@ async function createAccountLogic(
}

await interaction.editReply({
content: `Your personal invitation url: ${invitationUrl}. If you already have a CTFNote account you should link it using the /link command instead.`,
content: `Your personal invitation url: ${invitationUrl}.\n-# If you already have a CTFNote account you should link it using the \`/link\` command using the Discord token from your profile: ${await getProfileUrl()}.`,
});
return;
}
Expand Down

0 comments on commit ee44665

Please sign in to comment.