diff --git a/AllTheLittleThings.lua b/AllTheLittleThings.lua index bda94e8..1ab9ca6 100644 --- a/AllTheLittleThings.lua +++ b/AllTheLittleThings.lua @@ -61,14 +61,20 @@ function core:RegisterOptions(modOptions, modDefaults) end function core:RegisterSlashCommand(callback, ...) - local long = "" + local keyword for i=1,select('#', ...) do local slash = select(i, ...) + if slashCallback[slash] then + error(("Slash command paramter already registered: '%s'"):format(slash)) + end slashCallback[slash] = self[callback] - long = string.len(slash)>string.len(long) and slash or long + + if not keyword or slash:len() < keyword:len() then + keyword = slash + end end - slashList[long] = ("|cff33ff99%s|r:%s()"):format(self:GetName(), callback) + slashList[("|cff33ff99%s|r:|cffcc7833%s()|r"):format(self:GetName(), callback)] = keyword end function core:MainSlashHandle(msg) diff --git a/modules/announce.lua b/modules/announce.lua index 19aec08..d8ace0e 100644 --- a/modules/announce.lua +++ b/modules/announce.lua @@ -58,7 +58,6 @@ local armorGlyphs = { function mod:OnInitialize() db = core.db.profile[self:GetName()] or {} self:RegisterOptions(options, defaults) - self:RegisterSlashCommand("method", "slsh1", "slash2") end function mod:OnEnable()