This commit is contained in:
Jiiks 2015-12-12 14:54:21 +02:00
parent 8520f1512d
commit 4262dcf111
1 changed files with 8 additions and 1 deletions

View File

@ -1344,7 +1344,10 @@ BdApi.getCore = function() {
return mainCore; return mainCore;
}; };
//Attempts to get user id by username
//Name = username
//Callback = callback function
//Since Discord hides users if there's too many, this will often fail
BdApi.getUserIdByName = function(name, callback) { BdApi.getUserIdByName = function(name, callback) {
$(".member-username").each(function() { $(".member-username").each(function() {
if($(this).text() == name) { if($(this).text() == name) {
@ -1355,6 +1358,10 @@ BdApi.getUserIdByName = function(name, callback) {
}); });
}; };
//Attempts to get username by id
//ID = user id
//Callback = callback function
//Since Discord hides users if there's too many, this will often fail
BdApi.getUserNameById = function(id, callback) { BdApi.getUserNameById = function(id, callback) {
$(".avatar-small").each(function() { $(".avatar-small").each(function() {
var url = $(this).css("background-image"); var url = $(this).css("background-image");