sentanos / roblox-js

!!!THIS PROJECT IS NO LONGER MAINTAINED!!! Execute ROBLOX website actions in node.js
MIT License
45 stars 45 forks source link

onJoinRequestHandle error #71

Closed LukeeRBLX closed 6 years ago

LukeeRBLX commented 6 years ago

Hello.

I seem to keep getting this error when using the onJoinRequestHandle. The error that I receive:

Unhandled rejection Error: Initialization failed: Group admin page load failed, make sure the user is in the group and is allowed to handle join requests
    at C:\Users\test\Desktop\flyaztecabot\node_modules\roblox-js\lib\util\shortPoll.js:76:23
    at tryCatcher (C:\Users\test\Desktop\flyaztecabot\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\test\Desktop\flyaztecabot\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Users\test\Desktop\flyaztecabot\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Users\test\Desktop\flyaztecabot\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Users\test\Desktop\flyaztecabot\node_modules\bluebird\js\release\promise.js:689:18)
    at Async._drainQueue (C:\Users\test\Desktop\flyaztecabot\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\Users\test\Desktop\flyaztecabot\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\Users\test\Desktop\flyaztecabot\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)

The code is the example code provided in the Group Functions WIKI.

Am I doing something wrong, or has Roblox blocked this feature?

Code:

var blacklist = [1, 261]
var evt = roblox.onJoinRequestHandle(18)
evt.on('data', function (request) {
  rbx.getIdFromUsername(request.username).then(function (id) {
    for (var i = 0; i < blacklist.length; i++) {
      if (blacklist[i] === id) {
        evt.emit('handle', request, false);
        return;
      }
    }
    evt.emit('handle', request, true, function () {
      rbx.message(id, 'Welcome', 'Welcome to my group');
    });
  });
});

Btw the user has full group permissions.

LukeeRBLX commented 6 years ago

This was fixed by not changing the number in the which i forgot to do D:

var evt = roblox.onJoinRequestHandle(18)

for anybody who is confused the 18 is meant for ur group ID.