Skip to content

Commit

Permalink
Minor formatting improvements to /dining menus
Browse files Browse the repository at this point in the history
This commit introduces minor formatting improvements to the output of the `/dining menus` command, including capitalization fixes and use of full venue names in certain locations.
  • Loading branch information
ZelnickB committed Jan 18, 2025
1 parent cf1d2dd commit 5088366
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions discordBot/commands/ChatInput/logic/dining.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ export default async function (interaction) {
switch (interaction.options.getSubcommand()) {
case 'menus': {
const venue = interaction.options.getString('venue')
const fullVenueName = dining.getVenueFullName(venue)
const meal = interaction.options.getString('meal')
const [, mealInfo] = await Promise.all([interaction.deferReply(), dining.getMealInfo(venue, meal)])
if (mealInfo === undefined) {
return interaction.editReply({
content: `**Error:** ${venue} is not open for ${meal.toLowerCase()} today, or the menu is not available.`
content: `**Error:** ${fullVenueName} is not open for ${meal.toLowerCase()} today, or the menu is not available.`
})
}
const menu = dining.parseMenu(mealInfo)
Expand Down Expand Up @@ -40,13 +41,13 @@ export default async function (interaction) {
}
}
const embed = new EmbedBuilder()
.setTitle(`${dining.getVenueFullName(venue)} ${meal} Menu`)
.setTitle(`${fullVenueName} ${meal} Menu`)
.setAuthor({
name: 'Massachusetts Institute of Technology Dining'
})
.setDescription(`${meal} is being served at ${venue} from ${mealInfo.start_time} to ${mealInfo.end_time} today.`)
.setFooter({
text: `Menu for ${meal} at ${venue} Dining, ${DateTime.now().setZone('America/New_York').toFormat('ccc d LLLL, yyyy')}.`
text: `Menu for ${meal.toLowerCase()} at ${fullVenueName}, ${DateTime.now().setZone('America/New_York').toFormat('ccc d LLLL, yyyy')}.`
})
.setColor(embedColor)
for (const station in menu) {
Expand Down

0 comments on commit 5088366

Please sign in to comment.