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:
@@ -78,7 +78,7 @@ exports.FormatMSS = function(s){
|
||||
exports.IsAdmin = function(client, user) {
|
||||
//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);
|
||||
}
|
||||
|
||||
let guild = client.guilds.get(process.env.SANCTUM_ID);
|
||||
@@ -107,14 +107,14 @@ exports.CheckValidDisplay = function(client, member, channel, checkRole) { //See
|
||||
//handle member strings
|
||||
if (typeof(member) === "string") {
|
||||
//get the member
|
||||
let user = client.users.find(item => item.username === member);
|
||||
let user = client.users.find(item => item.username === member || item.id === member);
|
||||
let guild = client.guilds.get(process.env.SANCTUM_ID);
|
||||
member = guild.members.get(user.id);
|
||||
}
|
||||
|
||||
//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);
|
||||
}
|
||||
|
||||
switch(client.user.username) {
|
||||
|
||||
Reference in New Issue
Block a user