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