Skip to content

Commit

Permalink
fix town list and resident
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Oct 14, 2024
1 parent f73f890 commit da8ac61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aurora/common/resident.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ResidentHelper extends BaseHelper {

let resident: V3Player
try {
const players = await OfficialAPI.V3.players()
const players = await OfficialAPI.V3.players(arg1)
resident = players[0] as V3Player
} catch(e: any) {
console.error(e)
Expand Down
5 changes: 4 additions & 1 deletion aurora/slashcommands/town.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default {
.then(m => setTimeout(() => m.delete(), 10000))

const townEmbed = new EmbedBuilder()
const nameArg = interaction.options.getString("name", true)

const subCmdName = interaction.options.getSubcommand().toLowerCase()
if (subCmdName == "list") {
Expand Down Expand Up @@ -132,6 +131,8 @@ export default {
}
}
else if (subCmdName == "activity") {
const nameArg = interaction.options.getString("name", true)

const town = towns.find(t => t.name.toLowerCase() == nameArg.toLowerCase())
if (!town) return interaction.editReply({embeds: [new EmbedBuilder()
.setTitle("Invalid town name!")
Expand Down Expand Up @@ -177,6 +178,8 @@ export default {
.editInteraction(interaction)
}
else if (subCmdName == "lookup") { // /t <town>
const nameArg = interaction.options.getString("name", true)

const town = towns.find(t => t.name.toLowerCase() == nameArg.toLowerCase())
if (!town) return await interaction.editReply({embeds: [new EmbedBuilder()
.setTitle("Invalid Town!")
Expand Down
1 change: 1 addition & 0 deletions bot/utils/fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ export const paginator = async(
msg: Message,
embeds: EmbedBuilder[],
currentPage: number,
// TODO: Implement this
_forwardCallback?: (
interaction: ButtonInteraction,
msg: Message, embeds: EmbedBuilder[]
Expand Down

0 comments on commit da8ac61

Please sign in to comment.