Is anyone having this problem? I’ve tried for like 30 minutes but it fails.
Bad cookie.
Stored relog failed. Trying with given.
Error running server: Error: No cookie supplied and no cookie file available.
Stored relog failed. Trying with given.
Error: Did not receive X-CSRF-TOKEN
at /rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/noblox.js/4.3.0/node_modules/noblox.js/lib/util/getGeneralToken.js:26:15
at tryCatcher (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/rbd/pnpm-volume/57e3ff28-ee82-4cb2-9cab-afad3ab15817/node_modules/.registry.npmjs.org/bluebird/3.7.2/node_modules/bluebird/js/release/async.js:15:14)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
Error running server: Error: No cookie supplied and no cookie file available.```
Leme tell you about this, so Glitch permits bots, but not 24/7 hosting. Attempting to ping your project from a pinging website will end up in it being susupended or deleted. This was explained in their forms.
This will get the project banned. ANY pinging service used will result in a suspended or deleted project. It happened to a big project yesterday. But, Glitch does allow boosted projects to be up 24/7 no ping with more resources. More info here. The problem is it is per-project. meaning that you have to boost certain projects. And due to people trying to bypass the ping ban, you now get 1000 hours each month for your entire account. They reset at the begining of each month. But the reason really does make since. They are making less money than they are losing.
Your problem is you need a new cookie also. Change the API module to the newer one. You are sending the request to /GroupShout instead of /group/shout. In the newer module. you don’t need the group argument for example: lua print(api.promote(1).message).
It’s either you didn’t supply a valid cookie or even a cookie at all or your cookie has expired.
You’d have to use this Cookie Pool System and then get Glitch Premium. Then you must install the node-cron package and then add with the separate files with the cookie pool system on your Glitch project. and then enter this code on server.js after your current code in that file:
cron.schedule("* * * * *", () => {
console.log("running a task at the start of every minute");
//function logic goes here
// Dependencies
var parser = require("cheerio");
// Define
exports.func = function(args) {
var $ = args.selector;
if (!$) {
$ = parser.load(args.html);
}
var inputs = {};
var find = [
"__VIEWSTATE",
"__VIEWSTATEGENERATOR",
"__EVENTVALIDATION",
"__RequestVerificationToken"
];
for (var i = 0; i < find.length; i++) {
var get = find[i];
inputs[get] = $("input[name=" + get + "]").val();
}
return inputs;
};
const no = require("./noblox.js");
async function test() {
await no.setCookie("Cookie");
try {
const t = await no.getGeneralToken();
console.log(`Token, `, t);
} catch (e) {
console.error(`Failed: `, e);
}
}
test();
/**
* Module used to reload a cookie
*/
const request = require("request-promise");
const getVerificationInputs = require("./getVerificationInputs").func;
module.exports = {
/**
* Get the RequestVerificationToken
*
* @param {string} Cookie
*/
getVerification: cookie => {
return new Promise((resolve, reject) => {
return request({
url: "https://www.roblox.com/my/account#!/security",
resolveWithFullResponse: true,
headers: {
cookie: `.ROBLOSECURITY=${cookie}`
}
}).then(res => {
const inputs = getVerificationInputs({ html: res.body });
var match;
if (res.headers && res.headers["set-cookie"]) {
match = res.headers["set-cookie"]
.toString()
.match(/__RequestVerificationToken=(.*?);/);
}
resolve({
inputs: inputs,
header: match && match[1]
});
});
});
},
/**
* Get the general token
*
* @param {string} Cookie
*/
getGeneralToken: async cookie => {
return new Promise((resolve, reject) => {
return request({
// This will never actually sign you out because an X-CSRF-TOKEN isn't provided, only received
url: "https:////auth.roblox.com/v1/logout", // REQUIRES https. Thanks for letting me know, ROBLOX...
resolveWithFullResponse: true,
method: "POST",
headers: {
cookie: `.ROBLOSECURITY=${cookie}`
}
}).catch(res => {
var xcsrf = res.response.headers["x-csrf-token"];
if (xcsrf) {
resolve(xcsrf);
} else {
reject("Did not receive X-CSRF-TOKEN");
}
});
});
},
/**
* Reload a cookie
*
* @param {string} Cookie
*/
relog: cookie => {
return new Promise(async (resolve, reject) => {
if (!cookie) reject("no cookie supplied?");
// Get verification token
const verificationToken = await module.exports.getVerification(cookie);
if (!verificationToken.header) return reject("Bad cookie");
// Get general token
const generalToken = await module.exports.getGeneralToken(cookie);
// Refresh the token
return request({
url:
"https://www.roblox.com/authentication/signoutfromallsessionsandreauthenticate",
method: "POST",
resolveWithFullResponse: true,
headers: {
"X-CSRF-TOKEN": generalToken,
cookie: `.ROBLOSECURITY=${cookie}`
},
form: {
__RequestVerificationToken:
verificationToken.inputs.__RequestVerificationToken
}
})
.then(res => {
const cookies = res.headers["set-cookie"];
if (cookies) {
const newCookie = cookies
.toString()
.match(/\.ROBLOSECURITY=(.*?);/)[1];
resolve(newCookie);
} else {
reject("Bad Roblox response");
}
})
.catch(() => {
reject("Bad Roblox response");
});
});
}
};
rbx.refreshCookie(cookie);
});
Once that is done, please insert a valid cookie and then you are good. You should also replace cookieLogin with setCookie.