implements web verification

This commit is contained in:
Matthieu Jolimaitre 2024-02-02 16:45:08 +01:00
parent a7799eb3b1
commit 440e8bf324
9 changed files with 303 additions and 28 deletions

View file

@ -70,6 +70,15 @@ export class EpitlsBot {
return this.bot.user?.displayName;
}
public async get_username(user_id: string) {
try {
const user = await this.bot.users.fetch(user_id);
return user.displayName;
} catch (_) {
return undefined;
}
}
private async register_commands() {
const cmd = new SlashCommandBuilder()
.setName("associate")
@ -103,6 +112,7 @@ export class EpitlsBot {
this.assoc_channel.send({ cri_login, discord_user_id, callback: resolver });
await interaction.reply(message_command_response_sending_email(email));
log(`Started verification for discord id '${discord_user_id}' with cri login '${cri_login}'.`);
const result = await promise;
if (result === true) interaction.editReply(message_command_response_success());
else interaction.editReply(message_command_response_error(result));