diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..764adcd Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/features/raid-bots/request-subcommand.ts b/src/features/raid-bots/request-subcommand.ts index c5967a2..8fa0892 100644 --- a/src/features/raid-bots/request-subcommand.ts +++ b/src/features/raid-bots/request-subcommand.ts @@ -50,6 +50,30 @@ Password: ${spoiler(details.password)} response += `** Please note that ${currentPilot} is marked as the pilot of ${name} and you may not be able to log in. Your name will not be added as the botpilot in the public bot sheet! **\n\n`; } response += `The credentials for ${name} have been DM'd to you. Please remember to use \`/bot park\` when you are done!`; + + const logMsg = await thread.send("OK"); + logMsg.edit(`${status} ${interaction.user} access to ${name}.`); + + if (await publicAccounts.isBotPublic(name)) { + try { + const guildUser = await interaction.guild?.members.fetch( + interaction.user.id + ); + + if (!currentPilot) { + await publicAccounts.updateBotRowDetails(name, { + [BOT_SPREADSHEET_COLUMNS.CurrentPilot]: + guildUser?.user.username || "UNKNOWN USER", + [BOT_SPREADSHEET_COLUMNS.CheckoutTime]: moment().toString(), + }); + } + } catch (err) { + throw new Error( + "Failed to update public record, check the configuration" + ); + } + } + await interaction.editReply(response); } catch (err) { status = "❌ Denied"; @@ -58,30 +82,6 @@ Password: ${spoiler(details.password)} `You do not have the correct permissions to access ${name}.` ); } - - const logMsg = await thread.send("OK"); - logMsg.edit(`${status} ${interaction.user} access to ${name}.`); - - // Update public record - if (await publicAccounts.isBotPublic(name)) { - try { - const guildUser = await interaction.guild?.members.fetch( - interaction.user.id - ); - - if (!currentPilot) { - await publicAccounts.updateBotRowDetails(name, { - [BOT_SPREADSHEET_COLUMNS.CurrentPilot]: - guildUser?.user.username || "UNKNOWN USER", - [BOT_SPREADSHEET_COLUMNS.CheckoutTime]: moment().toString(), - }); - } - } catch (err) { - throw new Error( - "Failed to update public record, check the configuration" - ); - } - } } public get command() {