Skip to content

Commit

Permalink
Tour-cmd: Allow aliases for custom formats
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinSRG committed Dec 16, 2024
1 parent 6c8cafe commit 00c59aa
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/bot-modules/tour-cmd/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 00c59aa

Please sign in to comment.