With this snippet you can get informatiojn about roblox groups simply by it's ID using latest version of RobloxCore. To use it go to https://autocode.com/tools/discord/command-builder/ and create new commnd called /rbx-group with intiger option called ID that is required. If you need any help contact me on twitter or Discord (links on profile). Enjoy!
// Authenticates you with the API standard library
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
await lib.discord.interactions['@1.0.0'].responses.create({
token: `${context.params.event.token}`,
response_type: 'DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE',
});
// Get string what we will search
let string = context.params.event.data.options[0].value;
var result;
try {
// Make API request
var result = await lib.robloxCore.groups['@1.0.1'].search({
groupId: string,
});
let testData = result.name;
} catch (e) {
await lib.discord.interactions['@1.0.0'].followups.create({
token: `${context.params.event.token}`,
content: `Unknown error occurred.`,
});
return;
}
if (result != undefined) {
// Create message with all data what Roblox give us back
await lib.discord.interactions['@1.0.0'].followups.create({
token: `${context.params.event.token}`,
content: ``,
embeds: [
{
type: `rich`,
title: `Roblox group search info`,
description: `Best result for \**${string}\**.`,
color: 0x303136,
fields: [
{
name: `Group name`,
value: `${result.name}`,
},
{
name: `Group description`,
value: result.description || 'No description',
},
{
name: `Group ID`,
value: `${result.id}`,
},
],
thumbnail: {
url: result.groupIcon,
height: 0,
width: 0,
},
},
],
});
} else {
await lib.discord.interactions['@1.0.0'].followups.create({
token: `${context.params.event.token}`,
content: `Unknown error occurred.`,
});
}