Skip to content
Snippets Groups Projects
Unverified Commit ce27f927 authored by Maxime FRIESS's avatar Maxime FRIESS :blue_heart:
Browse files

[commands/menu] Fixed typo

parent d78c8952
Branches
Tags
No related merge requests found
......@@ -37,7 +37,7 @@ export class MenuCommand extends Command {
constructor() {
super();
Bot.registerButton('menu_date', this.buttonDate.bind(this));
Bot.registerSelect('menu_switch', this.selectRestaurent.bind(this))
Bot.registerSelect('menu_switch', this.selectRestaurant.bind(this))
}
getName() {
......@@ -63,7 +63,7 @@ export class MenuCommand extends Command {
},
{
type: ApplicationCommandOptionType.String,
...I18n.argumentI18n(this, "restaurent"),
...I18n.argumentI18n(this, "restaurant"),
choices: RU.getRUArguments(),
required: false,
}
......@@ -79,7 +79,7 @@ export class MenuCommand extends Command {
await interaction.editReply(await this.getMessageContent(date, filter, parseInt(re), parseInt(ra), interaction.locale));
}
async selectRestaurent(interaction: SelectMenuInteraction) {
async selectRestaurant(interaction: SelectMenuInteraction) {
const [, d, f] = interaction.customId.split(",");
const [region, restaurant] = interaction.values[0].split(",").map(x => parseInt(x));
const date = moment(d, DATE_FORMAT).toDate();
......@@ -92,7 +92,7 @@ export class MenuCommand extends Command {
async execute(interaction: CommandInteraction) {
const date = interaction.options.getString('date') === null ? new Date() : moment(interaction.options.getString('date'), DATE_FORMAT).toDate();
let filter = (interaction.options.getString('groupe') ?? 'ETU') as FilterValues;
const [region, restaurent] = (interaction.options.getString('restaurent') ?? DEFAULT_RU).split(',').map(x => parseInt(x));
const [region, restaurant] = (interaction.options.getString('restaurant') ?? DEFAULT_RU).split(',').map(x => parseInt(x));
if (isNaN(date.getTime())) {
await interaction.reply({ content: I18n.getI18n("bot.error.date", interaction.locale), ephemeral: true });
......@@ -100,7 +100,7 @@ export class MenuCommand extends Command {
}
await interaction.deferReply();
await interaction.editReply(await this.getMessageContent(date, filter, region, restaurent, interaction.locale));
await interaction.editReply(await this.getMessageContent(date, filter, region, restaurant, interaction.locale));
}
async getMessageContent(date: Date, filter: FilterValues, region: number, restaurant: number, lang: string): Promise<InteractionReplyOptions> {
......@@ -119,7 +119,7 @@ export class MenuCommand extends Command {
if (meal.name == 'midi') {
const embed = new MessageEmbed().setColor(SoftConfig.get('bot.color', '#fb963a')).setTimestamp(Cache.modified_date('crous.menu'));
for (const cat of meal.foodcategory.sort(this.__sortfunc)) {
// Filter is only needed for restaurent 1392 (Illkirch)
// Filter is only needed for restaurant 1392 (Illkirch)
// TODO: Clean this a bit.
if (cat.name.includes(filter) || restaurant !== 1392)
embed.addField(
......
......@@ -47,7 +47,7 @@ command.gdpr.option.policy.description,Lire la politique de confidentialité de
command.gdpr.export.reply,"Voici vos données, exportés au format JSON :","Here are your exported data, as JSON:"
,,
command.menu.name,menu,menu
command.menu.description,Récupère le menu du RU.,Get the menu of the University Restaurent.
command.menu.description,Récupère le menu du RU.,Get the menu of the University Restaurant.
command.menu.option.group.name,groupe,group
command.menu.option.group.description,Groupe,Group
command.menu.option.group.professor.name,Professeurs,Professors
......@@ -55,8 +55,8 @@ command.menu.option.group.student.name,Étudiants,Students
command.menu.option.group.all.name,Tous,All
command.menu.option.date.name,date,date
command.menu.option.date.description,Date (JJ/MM/AAAA),Date (DD/MM/YYYY)
command.menu.option.restaurent.name,restaurent,restaurent
command.menu.option.restaurent.description,Restaurent Universitaire,University Restaurent
command.menu.option.restaurant.name,restaurant,restaurant
command.menu.option.restaurant.description,Restaurant Universitaire,University Restaurant
command.menu.reply.day.next,Jour suivant,Next day
command.menu.reply.day.previous,Jour précédent,Previous day
command.menu.reply.title,Menu {filter} du {date},{filter} menu for the {date}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment