Scam Remove Bot

Hello my fellow robloxians. Everyday there are bots going around and posting scams in groups. and if you are like me then there are quete allot of scam posts in your group. so here i have a bot that will automaticly remove them and keeps an eye out for new incomming ones, a big thanks to @Etheroit who actualy helped me with the api’s

here are the following steps.

  1. install Node.JS

  2. install some sort of Code editor, i am using Atom

  3. make a Folder on your desktop. name doesnt matter here,

  4. Hold Shift and right click inside the folder and select run Commandpromt or Run Powershellimage

  5. Follow these following images.

  6. image

  7. image

  8. image

  9. image

  10. and then keep these empty and put your name in author
    image

  11. its asking you if the information is ok. just type yes and press enter

  12. alright its time to open your Code Editor, first what we are going to do is Make a index.js file, we located that at point 9,

13.alright we need to install 2 packages. open the commandpromt / powershell and type these lines
npm install npm install roblox.js
npm install request --save if request is saying can not be found. search on the node.js for the latest one,

this one is optional this will update your bot and restart when there are changes to the files,
npm install nodemon -g

  1. paste this code in side your index.js
var rbx = require('roblox.js');
var request = require('request');

var username = 'UserName of your bot';
var password = 'Pass of your bot';

var groupId = "00000";;

var keywords = [
  "thousands of robux",
  "thousands",
  "is giving access to",
  "giving access",
  "all game passes",
  "this is an official event",
  "official event",
  "no info needed","to the following link",
  "👉: rewardtool.se",
  "rewardtool.se",
  "rewardtool"
];

rbx.login(username, password).then(function() {
  console.log("LoggedIn");
  rbx.getWall({group: groupId}).then(function(data){
    var posts = data.posts
    for(var i = 0; i < data.posts.length; i++) {
      var found = 0;
      var message = data.posts[i]
      for (let phase of keywords) {
        if (message.content.toLowerCase().search(phase) != -1) found +=5;
      }
      if (/\S+\.\S+/.exec(message.content)) {
      //  found += 5;
      }
      if (found >= 5) {
          console.log("Removing Scam post from " + message.author.name );
          rbx.deleteWallPost({id:message.id, group:groupId}).catch(function(e) { });
        //  rbx.exile({group: groupId, target: message.author, deleteAllPosts: true});
      }
    }
  }).catch(function(e) { console.log(e); });

  var onWallPost = rbx.onWallPost({group: group});
  onWallPost.on("data", function(data) {
    var found = 0;
    for (let phase of keywords) {
      if (data.content.toLowerCase().search(phase) != -1) found+=5;
    }
    if (/\S+\.\S+/.exec(data.content)) {
    //  found += 5;
    }
    if (found >= 5) {
        console.log("Removing post with `" + data.content + "`` content!");
      rbx.deleteWallPost({id:data.id, group:groupId}).catch(function(e) { });
    }
  });
  onWallPost.on("close", function(e) { console.log("The event has disconnected!"); });
  onWallPost.on("error", function(e) {});
}).catch(function(e) {});

.15 Make a .bat script that runs the bot
node index.js
pause
Note if you installed nodemon use the following .bat code
nodemon index.js
pause

Here are the files if yours is not working.

if anything is not working or if your having trouble please comment under here. and i try to find a solution

78 Likes

“roblox.js” ? That’s not a valid package. :frowning:

Do you mean noblox.js or roblox-js? They’re both the same, it’s just that noblox.js has a bit more features and is maintained. (this is biased probably)

EDIT: Might as well add “robux”, “make money”, “ROBLOX is giving” to that block list too.

1 Like

roblox-js isn’t maintained anymore so use noblox.js

2 Likes

You should use require("0q0-roblox") as roblox.js haa outdated scripts.

4 Likes

You can aswell use okwo yeah,

2 Likes

Facts about the “bot”

This doesn’t work, “roblox.js” is outdated as @Etheroit pointed out. Roblox has no proper API for the website so every time the website gets an update we’re back to where we started. @Etheroit suggested to use “0q0-roblox” however it doesn’t work either. Neither of them do. In conclusion I want to say that this idea will never work. There’s no official API, the unofficial ones is either unofficial or not even functional. With “roblox.js” you get “You do not have permission to view the wall” as error, even though I made a role for the bot with all permissions activated. Moving on to “0q0-roblox”, it seems to work, however when finally a bot posted some of the words in the “blacklist” I received the error “Delete wall post failed, make sure you have permission to manage the wall” once again, the bot has all permissions activated and should work.

My opinion about how it’s written

It’s written in a terrible way if I may be honest with you @DutchDeveloper. It doesn’t print the errors so getting an idea what the issue is was nearly impossible. If you want to even have a chance to view your errors replace this:

onWallPost.on(“close”, function(e) { console.log(“The event has disconnected!”); });
onWallPost.on(“error”, function(e) {});
}).catch(function(e) {});

With this:

onWallPost.on(“close”, function(e) { console.log(“The event has disconnected!”,e); });
onWallPost.on(“error”, function(e) { console.log(“Unexpected error:”, e);});
}).catch(function(e) {
console.log(“Unexpected error:”, e);
});

Conclusion

The “bot” doesn’t work at all, whenever you use an “updated” unofficial API or not. Until Roblox releases an official API for the Website we’ll never have bots protecting our groups for us. The “bot” as @DutchDeveloper wrote is far from done and the code is not user friendly at all. Hoped to have a bot running 24/7 on my server but that’s just to cancel that plan.

Thank you,
Tor_Laws

9 Likes

Adding onto what I said above, after contacting @DutchDeveloper over Discord he sent me another version of the bot. After few errors I got it working, there’s still errors and mistakes that needs to be corrected, however, we’re making progress.

4 Likes

Thank you, always great work out of you and Kurka!

1 Like

Proper, official API to log in

Proper, official API to get group wall posts

Proper, official API to delete a group wall post

Proper, official API to delete all group wall posts by a specific user

General usage procedures

To make any request, you need a valid X-CSRF-TOKEN header. If you lack it or yours is invalid then your request will fail. When it fails, roblox will give you a valid X-CSRF-TOKEN in the response header, which you can use for your next request to make it succeed. I think X-CSRF-TOKENs are authenticated separately for each subdomain.

To make requests that require authentication, you need .ROBLOSECURITY=... in your Cookie header. Roblox will return this as part of the Set-Cookie response header when you use the login API.

So general procedure for a group wall scam post delete bot:

  1. Make blank login request to get CSRF token
  2. Make new login request with valid CSRF token to get authentication cookie
  3. Make blank group wall get request to get CSRF token
  4. Make valid group wall get request while providing your auth cookie and CSRF token to get group wall posts.
    4.1. Save returned CSRF token
    4.2. Search through group wall posts and add any user ids that make scams to an array
  5. Make a valid group wall user posts delete request while providing your auth cookie and CSRF token to delete all posts by a user.
    5.1 Save returned CSRF token
    5.2 Repeat for all users in delete-posts-by array.
  6. Jump to step 4 and repeat every 15 seconds or so.

The methods of impersonating a regular user behind a regular browser that roblox-js, noblox-js, and 0q0-roblox and their forks use is mostly not necessary any more. Here is a list of new web endpoints (ignore the thread title, or read through the thread to understand its relevance).

17 Likes

Thank you.

1 Like

This is due to roblox-js not being updated after manual wall page selection was removed.

I already know, I am pointed out stuff for people that don’t.

1 Like

Not sure on what you’ve meant about “Delete wall post failed” as it’s really working perfect for me.


Just make sure that bot’s rank is lower than the sender’s rank.

3 Likes

Fellas, Novaly studios has had this issue solved forever! Just set your group to private, and then accept all join requests. Because of how many groups one bot tries to join (more than its max 5), they never get into your group!

eNjOY qUAliTy ConVeRSaTioN1

7 Likes

This is not a solution. People often join groups associated with games to give instant feedback on their experience. If the group is set to manual approval this often puts people off of joining the group, and they could be waiting more than 12 hours to be accepted into the group.

10 Likes

I’ve also found a solution I’ve proposed to Dutch. Make the primary role without permission to post on chat and then auto-rank people to other, which does have it.

1 Like

Yeah, I realized that some hours after. So now it works :slight_smile:

1 Like

Glad it does. Was a little bit surprised tbh.
PS: Sorry for giving you code with no better error handling. Just it was a quick job and thought that it won’t be released for educational purposes (just for running it on server and preventing crashes)

1 Like

Oh by the way, the part with looking for new posts (it stays online waiting for a new post) doesn’t work, so you have to do everything manually.

1 Like

Hm? I don’t reallt understand. It works quite perfect for me. It checks every few seconds about new posts.