The correct syntax would be: function myFunction(msg) { // ... } on('chat:message', myFunction); When you only supply the function name like this, it's a reference to the function. When you use myFunction(msg) as in your example, it's actually calling the function, and the return value is what's passed to on. If your function returned a function object that would be fine, but that's not generally the case. If you look at scripts on the GitHub repo, this is common for the ones which utilize the Revealing Module Pattern (Aaron and I both use it extensively in our scripts). They often take a form similar to: var myNamespace = myNamespace || {}; myNamespace.mySript = (function() { 'use strict'; var version = 1.0; function handleInput(msg) { //... } function checkInstall() { //... } function registerEventHandlers() { on('chat:message', handleInput); } return { registerEventHandlers: registerEventHandlers, checkInstall: checkInstall }; }); on('ready', function() { 'use strict'; myNamespace.myScript.checkInstall(); myNamespace.myScript.registerEventHandlers(); });