sentanos / roblox-js

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

Shout - Not working? #64

Closed nishi7409 closed 6 years ago

nishi7409 commented 6 years ago

My code -


if (message.content.startsWith(prefix + "shout")){
    rbx.login(options)
    rbx.shout(3464814, "Testing...  Please work!!")
  }

Error - http://prntscr.com/h3i88v
sentanos commented 6 years ago

You are failing to use promises to wait for the login to complete.

rbx.login(options)
.then(function () {
  rbx.shout(...);
});

Also, it looks like you are making a discord bot. Instead of logging in when the command is executed just login when the bot is turned on and all the commands should be executed from that user.

// Put this at the top
rbx.login(options);
nishi7409 commented 6 years ago

Ah, fixed (forgot to comment earlier)!