noblox/noblox.js

[BUG] `deleteWallPost` always returning "You do not have permission to access this group wall."

nexpid opened this issue · 0 comments

Before posting a bug, be sure that someone else has not posted it already and it is an actual bug with noblox.js and not other frameworks like discord.js

Describe the bug
When I try to call noblox.deleteWallPost (with correct arguments), it always throws an "Error: 403: You do not have permission to access this group wall." - no matter the user's permissions.

To Reproduce

const noblox = require("noblox.js");

//...
noblox.deleteWallPost(123, 456);

Expected behavior
For the function not to throw an error

Screenshots
N/A

Additional context
I am using noblox.js@4.13.1 and the bot account I use has full access to the group.

I resolved this using

let cookie = `.ROBLOSECURITY=${ctx.client.nbcookie}`;

let xscrf = (
    await fetch("https://auth.roblox.com/v2/logout", {
        method: "POST",
        headers: {
            cookie,
        },
    })
).headers.get("x-csrf-token");

let daresp = await fetch(
    `https://groups.roblox.com/v1/groups/14517832/wall/posts/${wallpost}`,
    {
        method: "DELETE",
        headers: {
            cookie,
            "x-csrf-token": xscrf,
        },
    }
);