mirror of
https://github.com/Ratstail91/SANCTUM.git
synced 2025-11-29 10:34:26 +11:00
Shared library can now search for IDs
This commit is contained in:
@@ -17,7 +17,7 @@ exports.SendPublicMessage = function(client, user, channel, message, typingDelay
|
||||
|
||||
//handle user strings
|
||||
if (typeof(user) === "string") {
|
||||
user = client.users.find(item => item.username === user);
|
||||
user = client.users.find(item => item.username === user || item.id === user);
|
||||
if (!user) {
|
||||
throw "Can't find that user";
|
||||
}
|
||||
@@ -25,7 +25,7 @@ exports.SendPublicMessage = function(client, user, channel, message, typingDelay
|
||||
|
||||
//handle channel strings
|
||||
if (typeof(channel) === "string") {
|
||||
channel = client.channels.find(item => item.name === channel);
|
||||
channel = client.channels.find(item => item.name === channel || item.id === channel);
|
||||
if (!channel) {
|
||||
throw "Can't find that channel";
|
||||
}
|
||||
@@ -55,7 +55,7 @@ exports.SendPublicMessage = function(client, user, channel, message, typingDelay
|
||||
exports.SendPrivateMessage = function(client, user, message) {
|
||||
//handle user strings
|
||||
if (typeof(user) === "string") {
|
||||
user = client.users.find(item => item.username === user);
|
||||
user = client.users.find(item => item.username === user || item.id === user);
|
||||
}
|
||||
|
||||
user.send(message);
|
||||
|
||||
Reference in New Issue
Block a user