Either just create a named function for the OnEvent handler, and then call that whenever you want:
Code:
local function onEvent(self, event, ...)
print('congrats')
end
Congrats_Frame:SetScript("OnEvent", onEvent)
-- test
onEvent(Congrats_Frame, "PLAYER_LEVEL_UP")
..or get the applied function with
GetScript and do the same:
Code:
Congrats_Frame:SetScript("OnEvent", function onEvent(self, event, ...)
print('congrats')
end)
-- test
Congrats_Frame:GetScript("OnEvent")(Congrats_Frame, "PLAYER_LEVEL_UP")
You don't need to pass any arguments if you're not going to use them.