-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCommands.lua
More file actions
47 lines (40 loc) · 1.71 KB
/
Copy pathCommands.lua
File metadata and controls
47 lines (40 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
-- ============================================================
-- Commands.lua
-- Slash command registration and dispatch.
-- Loaded after CleanBot.lua; relies on globals set there.
-- ============================================================
-- ============================================================
-- /cleanbot | /cb
-- ============================================================
local NS = CleanBotNS
--- Toggles the main CleanBot window; requests a roster refresh when opening.
NS.CleanBot_Toggle = function()
if CleanBotFrame:IsShown() then
CleanBotFrame:Hide()
else
CleanBotFrame:Show()
NS.CB_RequestRosterThenRefresh()
end
end
--- Parses and dispatches the /cleanbot (/cb) slash command.
---@param msg string The raw slash argument text.
local function CB_HandleSlash(msg)
msg = msg:lower():match("^%s*(.-)%s*$")
if msg == "debug knownbots" then
NS.CB_ShowDebugKnownBots()
elseif msg == "" then
NS.CleanBot_Toggle()
else
NS.CB_Print("unknown command '" .. msg .. "'")
print(" /cleanbot — toggle window")
print(" /cleanbot debug knownbots — show KnownBots debug popup")
print(" /cbdebug — dump party/cache state to chat")
print(" /cbdebug bridge off — force bridge absent (whisper fallback)")
print(" /cbdebug bridge on — force bridge present (bridge path)")
print(" /cbdebug bridge reset — clear override; follow real handshake")
print(" /cbdebug simulate — toggle simulate mode (print instead of send)")
end
end
SLASH_CLEANBOT1 = "/cleanbot"
SLASH_CLEANBOT2 = "/cb"
SlashCmdList["CLEANBOT"] = CB_HandleSlash