This code utilizes Web API or HTTP Service. How to use: create a slash command for this command. it should look like /whois [content]. In the content box you should put the user ID (ROBLOX ID).
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN}); // Discord Token
const noblox = require('noblox.js'); // https://noblox.js.org
let content = context.params.event.content.split(' ').slice(1);
//--------------------------------------------------------------------REQUIRE STUFF AND UH YEAH------------------------------------------------------------------------------//
let link = await lib.http.request['@1.1.6'].get({
url: `https://users.roblox.com/v1/users/search?keyword=${content}&limit=10`,
});
let id = link.data.data[0].id;
const rankName = await noblox.getRankNameInGroup(8975006, id);
let rank = rankName;
console.log(rank); // Added this for testing! Really helpful
let link2 = await lib.http.request['@1.1.6'].get({
url: `https://users.roblox.com/v1/users/${id}`,
});
let link3 = await lib.http.request['@1.1.6'].get({
url: `https://thumbnails.roblox.com/v1/users/avatar-bust?userIds=${id}&size=420x420&format=Png&isCircular=false`,
});
let followers = await lib.http.request['@1.1.6'].get({
url: `https://friends.roblox.com/v1/users/${id}/followers/count`,
});
let followings = await lib.http.request['@1.1.6'].get({
url: `https://friends.roblox.com/v1/users/${id}/followings/count`,
});
let friends = await lib.http.request['@1.1.6'].get({
url: `https://friends.roblox.com/v1/users/${id}/friends/count`,
});
let userhistory = await lib.http.request['@1.1.6'].get({
url: `https://users.roblox.com/v1/users/${id}/username-history`,
});
//-------------------------------------------------------------------------=----Extra Let Stuff-------------------------------------------------------------------------------------//
let name = link.data.data[0].name;
let displayName = link.data.data[0].displayName;
let description = link2.data.description;
let avatar = link3.data.data[0].imageUrl;
let userhistory2 = userhistory.data.data[0].name;
//-----------------------------------------------------EMBED PART, GO TO https://autocode.com/tools/discord/embed-builder/---------------------------------------------------------//
await lib.discord.channels['@0.3.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embeds: [
{
type: 'rich',
title: '',
description: `**Roblox Profile**\nUsername: ${name}\n Display Name: ${displayName}\n Previous Username: ${userhistory2}\n \nRoblox ID: ${id}\n Followers: ${
followers.data.count || 'no followers available'
}\n Followings: ${
followings.data.count || 'no followings available'
}\n\nRoblox Bio: ${
description || 'no description available'
}\n Group Rank: ${rank}\nProfile Link: https://www.roblox.com/users/${id}/profile `,
color: 0x00ffff,
thumbnail: {
url: `${avatar}`,
height: 0,
width: 0,
},
author: {
name: `${name} | European Fallout Bot`, // This is my bot, use your own!
},
},
],
});