UNPKG

roblox-mass-unfollow

Version:

This can be used to mass unfollow users on Roblox.

56 lines (43 loc) 1.05 kB
#! /usr/bin/env node const chalk = require("chalk") const argv = require("./argv") const { Client } = require("bloxy") if (!argv.cookie) { console.error(chalk.bold.red("No --cookie option was provided")) return } const rbx = new Client({ credentials: { cookie: argv.cookie, }, }) async function start() { await rbx.login().catch((err) => console.error(err)) let user = rbx.user if (!user) { console.error(chalk.bold.red("Invalid cookie provided")) return } let done = false let nextCursor let data = [] while (!done) { let options = { limit: 100 } if (nextCursor) { options.cursor = nextCursor } let req = await user.getFollowing(options) data = [].concat(data, req.data) if (req.cursors.next && (!argv.max || data.length < argv.max + 1)) { nextCursor = req.cursors.next } else { nextCursor = null done = true } } data.forEach(async (v) => { let userToUnfollow = await rbx.getUser(v.id) userToUnfollow.unFollow() }) } start()