I have a simple eventhandler registered as on('chat:message', handleInput); and when i write in the chat and press enter the handleInput function is called twice? Is there a way to prevent that? Is that normal? Edit: The title is obviously wrong, sorry about that. Edit: I used a variable var registered = false; and var registerEventHandlers = function() { if(!registered){ on('chat:message', handleInput); on('change:token', handleToken); } registered = true; };
on("ready",function(){
'use strict';
Shadowrun.CheckInstall();
Shadowrun.RegisterEventHandlers();
});
Too check and now the eventHandlers are only registered once. Still I don't get why RegisterEventHandlers() is called twice.