From 31a13e000d6e096af3c5ee13df34fa3a44964ad4 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 19 Oct 2018 06:25:23 +1100 Subject: [PATCH] BUGFIX: Replaced userID with user in messaging.js --- Shared/messaging.js | 8 ++++---- Shared/testbot.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Shared/messaging.js b/Shared/messaging.js index 114a512..df12d92 100644 --- a/Shared/messaging.js +++ b/Shared/messaging.js @@ -12,16 +12,16 @@ exports.SendPublicMessage = function(client, user, channel, message, typingDelay if (message === undefined) { message = channel; channel = user; - userID = null; + user = null; } //handle user strings - if (typeof(user) == "string") { + if (typeof(user) === "string") { user = client.users.find(item => item.username === user); } //handle channel strings - if (typeof(channel) == "string") { + if (typeof(channel) === "string") { channel = client.channels.find(item => item.name === channel); } @@ -48,7 +48,7 @@ exports.SendPublicMessage = function(client, user, channel, message, typingDelay //message - message to send exports.SendPrivateMessage = function(client, user, message) { //handle user strings - if (typeof(user) == "string") { + if (typeof(user) === "string") { user = client.users.find(item => item.username === user); } diff --git a/Shared/testbot.js b/Shared/testbot.js index e433c34..e10dac1 100644 --- a/Shared/testbot.js +++ b/Shared/testbot.js @@ -21,7 +21,7 @@ client.on("disconnect", function() { client.on("message", function(msg) { //only react to commands - if (msg.content.slice(0, 1) != "!") { + if (msg.content.slice(0, 1) !== process.env.PREFIX) { return; } @@ -39,4 +39,4 @@ client.on("message", function(msg) { }); //actually log in -client.login("TOKEN"); \ No newline at end of file +client.login(process.env.DEVELOPER_TOKEN); \ No newline at end of file