Skip to content
Snippets Groups Projects
Commit 63085a7f authored by unknown's avatar unknown
Browse files

[Command] Correct menu typo

parent 0ebfd9bc
Branches
Tags
1 merge request!1[Command] Correct menu typo
......@@ -24,6 +24,7 @@ import Bot from '../Bot.js';
import Command from '../Command.js';
import SoftConfig from '../config/SoftConfig.js';
import Cache from '../utils/Cache.js';
import StringUtils from '../utils/String';
class MenuCommand extends Command {
constructor() {
......@@ -144,7 +145,7 @@ class MenuCommand extends Command {
.setTimestamp(Cache.modified_date('crous.menu'))
for (let cat of meal.foodcategory.sort(this.__sortfunc)) {
if (cat.name.includes(filter))
embed.addField(cat.name, cat.dishes.map((x) => ("> " + x.name)).join("\n"), false);
embed.addField(StringUtils.capitalize(cat.name), cat.dishes.map((x) => ("> " + StringUtils.capitalize(x.name))).join("\n"), false);
}
return { embeds: [embed], content: `Menu ${filter} du ${d}`, components: [row] };
}
......
/**
* Copyright © 2021 Tanguy Gimenez <gimeneztanguy@gmail.com>
*
* This file is part of Seb-BOT.
*
* Seb-BOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Seb-BOT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Seb-BOT. If not, see <https://www.gnu.org/licenses/>.
*/
import Logger from './Logger.js';
class StringUtils {
constructor() {
this.__logger = Logger.getLogger("Cache");
}
capitalize(stringToFormat) {
return stringToFormat.charAt(0).toUpperCase() + stringToFormat.slice(1).toLowerCase();
}
}
const instance = new StringUtils();
export default instance;
\ No newline at end of file
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