View Single Post
09-27-19, 05:13 AM   #5
erispope
A Deviate Faerie Dragon
Join Date: Sep 2019
Posts: 10
Originally Posted by Fizzlemizz View Post
If the sendChat does work, your event handler doesn't have any parameters to "receive" any events and the if/elseif checks will always fail.

Code:
function FSMB:OnEvent(event, ...)
	local arg1, arg2, arg3 = ...
You might want to look into C_ChatInfo.SendAddonMessage as I think the prefix is supposed to be the first parameter and I'm not sure the others are correct.
Quick aside - sending the "containing" table/object is only needed when a function is declared as Class:Method. A simple dot just means it is temporarily housed in that table and you can use local SendAddonMessage =C_ChatInfo.SendAddonMessage if you want without having to pass in C_ChatInfo.

I'm sure I explained it poorly,but the : Vs . Rule is what I use (or if the function requires self as first parameter which is functionally equivalent to having the : ).
  Reply With Quote