From ac48b1195c4cd68f716e4119181c720cc9ec8b4f Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Sun, 16 Oct 2016 22:34:58 +0100 Subject: Handle error and server messages --- commands.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'commands.js') diff --git a/commands.js b/commands.js index 138c55f..1847b74 100644 --- a/commands.js +++ b/commands.js @@ -5,14 +5,14 @@ module.exports.init = function(myClient) { client = myClient } -function sendMsg(message, channel) { +module.exports.sendMsg = function(message, channel) { client.say(channel, message); var chanTab = $("[data-tab='"+ channel +"'].chat"); - chanTab.append("

<" + myNick + "> " + message +"

"); + chanTab.append("

<" + globals.myNick + "> " + message +"

"); chanTab.scrollTop(chanTab.prop("scrollHeight")); } -function sendPm(message, nick) { +module.exports.sendPm = function(message, nick) { var chanTab = $("[data-tab="+nick+"].tab"); $(".active").removeClass("active"); @@ -31,7 +31,7 @@ function sendPm(message, nick) { var chatTab = $("[data-tab="+nick+"].chat"); console.log(nick + ': ' + message); client.say(nick, message); - chatTab.append("

<" + myNick + "> " + message +"

"); + chatTab.append("

<" + globals.myNick + "> " + message +"

"); chatTab.scrollTop(chanTab.prop("scrollHeight")); } -- cgit v1.2.3