mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 20:16:38 +09:00
Config
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
--- This config for command auth allows commands to be globally enabled and disabled during runtime
|
||||
--- This config for command auth allows commands to be globally enabled and disabled during runtime;
|
||||
-- this config adds Commands.disable and Commands.enable to enable and disable commands for all users
|
||||
-- @config Commands-Auth-Runtime-Disable
|
||||
|
||||
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
||||
local Global = require 'utils.global' --- @dep utils.global
|
||||
|
||||
@@ -8,10 +10,14 @@ Global.register(disabled_commands,function(tbl)
|
||||
disabled_commands = tbl
|
||||
end)
|
||||
|
||||
--- Stops a command from be used by any one
|
||||
-- @tparam string command_name the name of the command to disable
|
||||
function Commands.disable(command_name)
|
||||
disabled_commands[command_name] = true
|
||||
end
|
||||
|
||||
--- Allows a command to be used again after disable was used
|
||||
-- @tparam string command_name the name of the command to enable
|
||||
function Commands.enable(command_name)
|
||||
disabled_commands[command_name] = nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user