From 4262dcf11182e7d1293b944a1c54e9c6796eccf4 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Sat, 12 Dec 2015 14:54:21 +0200 Subject: [PATCH] Docs --- js/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 2ec1341..571ed27 100644 --- a/js/main.js +++ b/js/main.js @@ -1344,7 +1344,10 @@ BdApi.getCore = function() { 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) { $(".member-username").each(function() { 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) { $(".avatar-small").each(function() { var url = $(this).css("background-image");