Skip to content

Commit

Permalink
Update nation.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Jun 25, 2024
1 parent 74b68a6 commit 72ea730
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions aurora/slashcommands/nation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default {

if (comparator == "online") {
const onlinePlayers = await Aurora.Players.online().catch(() => {})
if (!onlinePlayers) return await interaction.editReply({embeds: [fn.fetchError]})
if (!onlinePlayers) return await interaction.editReply({ embeds: [fn.fetchError] })
.then(() => setTimeout(() => interaction.deleteReply(), 10000)).catch(() => {})

let towns = await database.Aurora.getTowns()
Expand Down Expand Up @@ -152,11 +152,12 @@ export default {
nationEmbed.setDescription(interaction.options.getString("name") + " is not a valid nation, please try again.")
nationEmbed.setColor(Colors.Red)

return interaction.editReply({embeds: [nationEmbed]})
return interaction.editReply({ embeds: [nationEmbed] })
}

const players = await database.getPlayers()
if (!players) return await interaction.editReply({embeds: [fn.databaseError]}).then(() => setTimeout(() => interaction.deleteReply(), 10000))
if (!players) return await interaction.editReply({ embeds: [fn.databaseError] })
.then(() => setTimeout(() => interaction.deleteReply(), 10000))

// Sort by highest offline duration
nation.residents.sort((a, b) => {
Expand Down Expand Up @@ -207,7 +208,7 @@ export default {
nationEmbed.setDescription(interaction.options.getString("name") + " is not a valid nation, please try again.")
nationEmbed.setColor(Colors.Red)

return interaction.editReply({embeds: [nationEmbed]})
return interaction.editReply({ embeds: [nationEmbed] })
}

const capitalColours = await Aurora.Towns.get(nation.capital.name).then((t: any) => {
Expand Down

0 comments on commit 72ea730

Please sign in to comment.