User:Godisme/HungrySlap.js

mainRoom.model.chats.bind('afteradd', $.proxy(function(chat) { if(chat.attributes.isInlineAlert && chat.attributes.text.indexOf('Imhungry4444 has joined the chat.') != -1 && chat.attributes.text.indexOf(wgUserName) != 0) { var chatEntry = new models.ChatEntry({roomId: this.roomId, name: wgUserName, text: '* Godisme slaps Hungry'}); this.socket.send(chatEntry.xport); } }, mainRoom));