Skip to content

Commit

Permalink
debug air
Browse files Browse the repository at this point in the history
  • Loading branch information
iernie committed Nov 21, 2024
1 parent e3a7da2 commit c6675c5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions commands/air.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,19 @@ const command: SlashCommand = {
const city =
location[0].city !== undefined ? location[0].city : interaction.options.getString("location")!.trim();

console.log(level);
console.log(city);
console.log(level);

const desc = description.variables.AQI.aqis.find(
(d) => level >= (d.from ?? d.to + 1) && level <= (d.to ?? d.from - 1),
)!;
);

await interaction.reply(`${city}: ${desc.description_EN} (${desc.short_description_EN})`);
if (desc) {
await interaction.reply(`${city}: ${desc.description_EN} (${desc.short_description_EN})`);
} else {
await interaction.reply("Air quality not found 🤷");
}
} else {
await interaction.reply("Air quality not found 🤷");
}
Expand Down

0 comments on commit c6675c5

Please sign in to comment.