Skip to content

Commit

Permalink
Improve Discord messages text
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ-8 committed Aug 4, 2024
1 parent 854dfcd commit 640ee90
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions api/src/discord/commands/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,21 @@ async function createAccountLogic(
const invitationUrl = await getInvitationUrl(existingInvitationCode);
if (invitationUrl == null) {
await interaction.editReply({
content: "Something went wrong.", // TODO: Meaningful error messages?
content:
"Could not generate invitation URL. Please contact an administrator.",
});
return;
}

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}. If you already have a CTFNote account you should link it using the \`/link\` command instead.`,
});
return;
}

await interaction.editReply({
content:
"Generating private invitation url... If you already have a CTFNote account you should link it using the /link command instead.",
"Generating private invitation url... If you already have a CTFNote account you should link it using the `/link` command instead.",
});

const invitationCode = await createInvitationTokenForDiscordId(
Expand All @@ -88,15 +89,17 @@ async function createAccountLogic(

if (invitationCode == null) {
await interaction.editReply({
content: "Something went wrong.", // TODO: Meaningful error messages?
content:
"Could not generate an invitation code. Please contact an administrator.",
});
return;
}

const invitationUrl = await getInvitationUrl(invitationCode);
if (invitationUrl == null) {
await interaction.editReply({
content: "Something went wrong.", // TODO: Meaningful error messages?
content:
"Could not get an invitation URL. Please contact an administrator.",
});
return;
}
Expand Down

0 comments on commit 640ee90

Please sign in to comment.