You don't tell us what the error says which would be helpful but...
The SLASH_NOVIDADE1, SLASH_NOVIDADE2 etc. are for different slash commands that call the same function (in case one gets overwitten by another addon or you want to have say, a full addon name command and an acronym command (but you only need one) eg.:
Code:
SLASH_NOVIDADE1 = "/novidade"
SLASH_NOVIDADE2 = "/nvd"
if NOVIDADE_ToggleFrame is defined as a local function, it needs to be declared before the SlashCmdList entry is created
Lua Code:
local function NOVIDADE_ToggleFrame()
MyFrame:SetShown(not MyFrame:IsShown ())
end
SlashCmdList["NOVIDADE"] = function(msg)
NOVIDADE_ToggleFrame()
end
I have no idea what the NOVIDADE_ToggleFrame function does so the code is just for exmple.