mirror of
https://github.com/Ratstail91/SANCTUM.git
synced 2025-11-29 02:24:27 +11:00
BUGFIX: Replaced userID with user in messaging.js
This commit is contained in:
@@ -12,16 +12,16 @@ exports.SendPublicMessage = function(client, user, channel, message, typingDelay
|
|||||||
if (message === undefined) {
|
if (message === undefined) {
|
||||||
message = channel;
|
message = channel;
|
||||||
channel = user;
|
channel = user;
|
||||||
userID = null;
|
user = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//handle user strings
|
//handle user strings
|
||||||
if (typeof(user) == "string") {
|
if (typeof(user) === "string") {
|
||||||
user = client.users.find(item => item.username === user);
|
user = client.users.find(item => item.username === user);
|
||||||
}
|
}
|
||||||
|
|
||||||
//handle channel strings
|
//handle channel strings
|
||||||
if (typeof(channel) == "string") {
|
if (typeof(channel) === "string") {
|
||||||
channel = client.channels.find(item => item.name === channel);
|
channel = client.channels.find(item => item.name === channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ exports.SendPublicMessage = function(client, user, channel, message, typingDelay
|
|||||||
//message - message to send
|
//message - message to send
|
||||||
exports.SendPrivateMessage = function(client, user, message) {
|
exports.SendPrivateMessage = function(client, user, message) {
|
||||||
//handle user strings
|
//handle user strings
|
||||||
if (typeof(user) == "string") {
|
if (typeof(user) === "string") {
|
||||||
user = client.users.find(item => item.username === user);
|
user = client.users.find(item => item.username === user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ client.on("disconnect", function() {
|
|||||||
|
|
||||||
client.on("message", function(msg) {
|
client.on("message", function(msg) {
|
||||||
//only react to commands
|
//only react to commands
|
||||||
if (msg.content.slice(0, 1) != "!") {
|
if (msg.content.slice(0, 1) !== process.env.PREFIX) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,4 +39,4 @@ client.on("message", function(msg) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//actually log in
|
//actually log in
|
||||||
client.login("TOKEN");
|
client.login(process.env.DEVELOPER_TOKEN);
|
||||||
Reference in New Issue
Block a user