Recherche TMR par coordonnées

This commit is contained in:
Vincent Vandemeulebrouck
2021-11-27 00:04:34 +01:00
parent ee45fee623
commit 648848aa03
3 changed files with 8 additions and 7 deletions

View File

@ -162,7 +162,7 @@ export class RdDCommands {
if (rollMode === "blindroll") msg["blind"] = true;
msg["type"] = 0;
let command = commandLine[0];
let command = commandLine[0].toLowerCase();
let params = commandLine.slice(1);
return this.process(command, params, content, msg);
@ -317,12 +317,12 @@ export class RdDCommands {
}
async findTMR(msg, params) {
const flat = Grammar.toLowerCaseNoAccent(Misc.join(params));
const found = TMRUtility.findTMR(flat);
const search = Misc.join(params, ' ');
const found = TMRUtility.findTMR(search);
if (found?.length > 0) {
return RdDCommands._chatAnswer(msg, `Les TMRs correspondant à '${flat}' sont:` + Misc.join(found.map(it => `<br>${it.coord}: ${it.label}`)));
return RdDCommands._chatAnswer(msg, `Les TMRs correspondant à '${search}' sont:` + Misc.join(found.map(it => `<br>${it.coord}: ${it.label}`)));
}
return RdDCommands._chatAnswer(msg, 'Aucune TMR correspondant à ' + flat);
return RdDCommands._chatAnswer(msg, 'Aucune TMR correspondant à ' + search);
}
/* -------------------------------------------- */