Implement enabling/disabling commands
This commit is contained in:
@@ -191,8 +191,11 @@ function shared.Commander.Init()
|
||||
sender = string.match(sender, "^[^-]+")
|
||||
|
||||
for _, command in ipairs(commands) do
|
||||
if not command.commanderOnly or
|
||||
(command.commanderOnly and sender == Heimdall_Data.config.commander.commander) then
|
||||
local enabled = Heimdall_Data.config.commander.commands[command.keywordRe] == true or false
|
||||
if enabled and
|
||||
(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
|
||||
|
||||
Reference in New Issue
Block a user