Roblox Group Rank Bot Help

So I am trying to make a bot for my upcoming cafe group that ranks players. Here is the code in game

local GlitchURL = "not included for obvious reasons"

function rankUser(UserId, RoleId)
	game:GetService("HttpService"):GetAsync(GlitchURL .. "ranker?userid=" .. UserId .. "&rank=" .. RoleId)
end

local UserId = 246908413
local RoleId = 3

rankUser(UserId, RoleId)

The userId is a random one I found from my group, and this is the code in the glitch project

var groupId = 6661045
var cookie = "again, not included for obvious reasons"

const express = require("express");
const rbx = require("noblox.js");
const app = express();

app.use(express.static("public"));

async function startApp() {
  await rbx.cookieLogin(cookie);
  let currentUser = await rbx.getCurrentUser();
  console.log(currentUser.UserName);
}
startApp();

app.get("/ranker", (req, res) => {
    var User = req.param("userid");
    var Rank = req.param("rank");
  
    rbx.setRank(groupId, parseInt(User), parseInt(Rank));
    res.json("Ranked!");
});

const listener = app.listen(process.env.PORT, () => {
  console.log("Your app is listening on port " + listener.address().port);
});

Whenever I go to the correct url it works fine, ranks the correct user and everything, but when I try to do it from studio, it doesn’t work (I do have http requests on)
I don’t know if this has anything to do with it, but when I go to the url it says waking up project and takes a while but when it’s up then it works fine. Does anyone know how to fix this?

1 Like

I think I figured it out, I don’t know if this is the best solution but if you have a better one then post it below, but basically what I did was add a Procfile and put this code inside it

worker node server.js

and it seems to work fine for now

The bottom script including the cookie is in a glitch project and it is using .js