Can you join a roblox group through the roblox API?

Hello everyone!

I am attempting to make a Discord to Roblox ranking bot (but will have more features), but the biggest problem I am having right now is trying to make it so the bot joins the group when they run the /setup command.

My command so far:

const { SlashCommandBuulder, EmbedBuilder, ModalBuilder, ActionRowBuilder, TextRowBuilder } = require('discord.js');
const serverSchema = require('../../Models/Server.js');
const request = require('request');

module.exports = {
  data: new SlashCommandBuilder()
    .setDescription('Sets up the bot for your server.'),
  async execute(interaction) {
    const server = await serverSchema.findOne({ serverId: });

    if (server.robloxGroupId == 0 && server.botJoined == false) {
      const setupModal1 = new ModalBuilder()

      const robloxGroupIdInput = new TextRowBuilder()
        .setLabel('Roblox Group ID')
        .setPlaceholder('Enter the Roblox Group ID')

      const robloxGroupIdActionRow = new ActionRowBuilder()


      const filter = (interaction) => interaction.customId === 'setupModal1';

      const collector ={ filter, time: 60000 });

      if (interaction.isModalSubmit()) {
        const robloxGroupId = interaction.fields.getTextInputValue('robloxGroupIdInput');

        if (isNaN(robloxGroupId)) {
          await interaction.reply({ content: 'Invalid Roblox Group ID. Please enter a valid number.', ephemeral: true });

        try {
          const headers = { authorization: `Bearer ${process.env.ROBLOX_API_KEY}`,"content-type": "application/json"" };
          await request.get(`${robloxGroupId}`, {
            method: "POST",
            headers: headers,
            json: true,
          }, async (error, response, body) => {
            if (error) {
              await interaction.reply({ content: 'An error occurred while checking the Roblox Group ID.', ephemeral: true });
            if (response.statusCode === 200) {
              const server = await serverSchema.findOne({ serverId: });
              if (server) {
                server.robloxGroupId = robloxGroupId;
              } else {
                const newServer = new serverSchema({
                  robloxGroupId: robloxGroupId,
              await interaction.reply({ content: 'Roblox Group ID set successfully.', ephemeral: true });
            } else {
              await interaction.reply({ content: 'Invalid Roblox Group ID. Please enter a valid number.', ephemeral: true });
        }catch (error) {

If someone could help me with this command that would be great.


What exactly is broken?

I can’t figure out if there is or isn’t a API for it. Some posts on the devforum say that there is and some say that there isn’t.

Basically im trying to figure out what the link is and the headers needed for it

1 Like

There is an endpoint to join a Roblox Group, however, it’s captcha protected and extremely hard to use.

Joins a group

P.s: I’ve edited your title to be more clear.

1 Like

So is it still doable with captcha? If so how would I be able to?

It’s doable but extremely difficult, it will required captcha solving and due to the fact that this can be maliciously exploited I can’t provide more feedback on that.

1 Like

Alright no worries. Thanks for the help :+1:

This topic was automatically closed after 7 days. New replies are no longer allowed.