diff --git a/Heimdall.toc b/Heimdall.toc index 7b377de..c4a09ac 100644 --- a/Heimdall.toc +++ b/Heimdall.toc @@ -1,5 +1,6 @@ ## Interface: 70300 ## Title: Heimdall +## Version: 2.11.0 ## Notes: Watches over areas and alerts when hostiles spotted ## Author: Cyka ## SavedVariables: Heimdall_Data diff --git a/Heimdall.zip b/Heimdall.zip index bb054fc..9923efd 100644 --- a/Heimdall.zip +++ b/Heimdall.zip @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:883378cad3fe389bd033fe5ed99f5a9e781461e41a3d25124ce55503a1998d26 -size 20088 +oid sha256:5ae446869148dfc8987fce98fd6b80ef6510e0a4ab39f7d872194ca3bdd04dd0 +size 20965 diff --git a/Modules/Commander.lua b/Modules/Commander.lua index 9819c07..eeecd09 100644 --- a/Modules/Commander.lua +++ b/Modules/Commander.lua @@ -167,18 +167,22 @@ function shared.Commander.Init() local channelId = select(6, ...) local _, channelname = GetChannelName(channelId) if channelname ~= Heimdall_Data.config.commander.masterChannel then return end + sender = string.match(sender, "^[^-]+") for _, command in ipairs(commands) do - if msg:match(command.keywordRe) then - local messages = command.callback({ strsplit(" ", msg) }) - for _, message in ipairs(messages) do - ---@type Message - local msg = { - channel = "CHANNEL", - data = channelname, - message = message - } - table.insert(shared.messenger.queue, msg) + if not command.commanderOnly or + (command.commanderOnly and sender == Heimdall_Data.config.commander.commander) then + if msg:match(command.keywordRe) then + local messages = command.callback({ strsplit(" ", msg) }) + for _, message in ipairs(messages) do + ---@type Message + local msg = { + channel = "CHANNEL", + data = channelname, + message = message + } + table.insert(shared.messenger.queue, msg) + end end end end