add setting macro if it not already exists somewhere in scope hierarchy

This commit is contained in:
LenAnderson 2024-07-05 19:13:11 -04:00
parent ba0f5427cf
commit 8785a0a5a3
1 changed files with 4 additions and 2 deletions

View File

@ -38,8 +38,10 @@ export class SlashCommandScope {
}
setMacro(key, value) {
this.macros[key] = value;
setMacro(key, value, overwrite = true) {
if (overwrite || !this.macroList.find(it=>it.key == key)) {
this.macros[key] = value;
}
}