From 00c59aa12248aedeff58d4a769678de288e29cd9 Mon Sep 17 00:00:00 2001 From: AgustinSRG Date: Mon, 16 Dec 2024 13:38:36 +0100 Subject: [PATCH] Tour-cmd: Allow aliases for custom formats --- src/bot-modules/tour-cmd/main.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/bot-modules/tour-cmd/main.js b/src/bot-modules/tour-cmd/main.js index d052fc9..93948f4 100644 --- a/src/bot-modules/tour-cmd/main.js +++ b/src/bot-modules/tour-cmd/main.js @@ -69,7 +69,21 @@ exports.setup = function (App) { } findCustomFormat(name) { - return Config.customFormats[Text.toId(name)] || null; + const id = Text.toId(name); + + const format = Config.customFormats[id]; + + if (format) { + return format; + } + + const alias = Config.aliases ? Config.aliases[id] : null; + + if (!alias) { + return null; + } + + return Config.customFormats[Text.toId(alias)] || null; } formatIsAvailable(name) {