Search anyone on roblox by doing !search (user). It will output the username, user display name, user id, user description.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let content = context.params.event.content.split(' ').slice(1)
//making http request to get all the user data
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
//making http request to get all the user data
let link2 = await lib.http.request['@1.1.6'].get({
url: `https://users.roblox.com/v1/users/${id}`
});
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 name = link.data.data[0].name
let displayName = link.data.data[0].displayName
let description = link2.data.description
await lib.discord.channels['@0.3.0'].messages.create({
"channel_id": `${context.params.event.channel_id}`,
"content": "",
"tts": false,
"embeds": [
{
"type": "rich",
"title": `${name}'s roblox account info`,
"description": "",
"color": 0x00FFFF,
"fields": [
{
"name": `\nusername:`,
"value": `${name}`
},
{
"name": `display name:`,
"value": `${displayName}`
},
{
"name": `user id:`,
"value": `${id}`
},
{
"name": `user description:`,
"value": `${description || 'no description'}`
},
{
"name": `user followers:`,
"value": `${followers.data.count || 'no followers'}`
},
{
"name": `user followings:`,
"value": `${followings.data.count || 'no followings'}`
},
]
}
]
});