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 function #47

Closed nishi7409 closed 7 years ago

nishi7409 commented 7 years ago

Every time I run the code below, I receive a, "Maximum call stack size exceeded", message.

Code... if (message.content.startsWith(prefix + "shout")) { let modRole = message.guild.roles.find("name", "admin"); if (!message.member.roles.has(modRole.id)) { return message.author.send("You can't run the shout command!") } else{ let args = message.content.split(" ").slice(1); rbx.shout(3413402, args[1], jar) message.channel.send("I've successfully shouted that message!") } let channel = bot.channels.get('344621842289524746') const embed = new Discord.RichEmbed() .setColor('0x32b55b') .addField('Action(s) Taken', "Shouted Message!") .addField('Administrator',${message.author}) .addField("User's Message",${message.content}) bot.channels.get(channel.id).sendEmbed(embed) }

Error... function arrayClone(arr, n) { ^

RangeError: Maximum call stack size exceeded at arrayClone (events.js:514:20) at emitNone (events.js:108:21) at IncomingMessage.emit (events.js:207:7) at IncomingMessage. (/Users/OnlyJumpAdministrator/Desktop/SOVEREIGN/botstuff/node_modules/request/request.js:950:39) at emitNone (events.js:105:13) at IncomingMessage.emit (events.js:207:7) at IncomingMessage. (_http_client.js:370:11) at emitNone (events.js:110:20) at IncomingMessage.emit (events.js:207:7) at IncomingMessage. (/Users/OnlyJumpAdministrator/Desktop/SOVEREIGN/botstuff/node_modules/request/request.js:950:39) at emitNone (events.js:105:13) at IncomingMessage.emit (events.js:207:7) at IncomingMessage. (_http_client.js:370:11) at emitNone (events.js:110:20) at IncomingMessage.emit (events.js:207:7) at IncomingMessage. (/Users/OnlyJumpAdministrator/Desktop/SOVEREIGN/botstuff/node_modules/request/request.js:950:39) at emitNone (events.js:105:13) at IncomingMessage.emit (events.js:207:7) at IncomingMessage. (_http_client.js:370:11) at emitNone (events.js:110:20) at IncomingMessage.emit (events.js:207:7) at IncomingMessage. (/Users/OnlyJumpAdministrator/Desktop/SOVEREIGN/botstuff/node_modules/request/request.js:950:39)

sentanos commented 7 years ago

Are you sure you are logged into jar? Where is the definition of jar? If you logged in without passing the same jar file into rbx.login you shouldn't pass in anything for jar in other functions.

sentanos commented 7 years ago

Just show your login code with username and password removed.

sentanos commented 7 years ago

Also be sure the error is originating from roblox-js and is not due to something else or a server configuration error. I'm not sure why that error would appear from shout.

nishi7409 commented 7 years ago

https://hastebin.com/iyifigijew.js

I believe, ROBLOX only allows you to shout multiple times after a couple minutes after each shout, correct me if I'm wrong.

sentanos commented 7 years ago

No, you can shout anytime. Your problem is something else. Although it wouldn't technically cause a problem, you don't have to be passing in jar anyways. You can just do rbx.shout(group, message) and it will shout using the global logged in user.

In order to isolate the problem try running rbx.getCurrentUser().then(console.log) once the login has completed and show the output.

nishi7409 commented 7 years ago

image

sentanos commented 7 years ago

When you use rbx.shout(314302, 'test') after login (not prompted by the command) what is the output?

nishi7409 commented 7 years ago

image

This was the code... https://hastebin.com/lupisobube.js

sentanos commented 7 years ago

Well... did it shout?

nishi7409 commented 7 years ago

Yes, it shouted.

On Aug 15, 2017 at 11:04 PM, <sentanos (mailto:notifications@github.com)> wrote:

Well... did it shout?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://github.com/sentanos/roblox-js/issues/47#issuecomment-322653593), or mute the thread (https://github.com/notifications/unsubscribe-auth/ATT-_n_t_uJa6Qws7_MXVo7v72BFqVywks5sYlxNgaJpZM4O4QSK).

sentanos commented 7 years ago

Then it doesn't sound like a problem with the module. Either you are passing in incorrect arguments or it is something with the discord module errorring.

On Aug 15, 2017, at 20:06, Nishant Srivastava notifications@github.com wrote:

Yes, it shouted.

On Aug 15, 2017 at 11:04 PM, <sentanos (mailto:notifications@github.com)> wrote:

Well... did it shout?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://github.com/sentanos/roblox-js/issues/47#issuecomment-322653593), or mute the thread (https://github.com/notifications/unsubscribe-auth/ATT-_n_t_uJa6Qws7_MXVo7v72BFqVywks5sYlxNgaJpZM4O4QSK).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

nishi7409 commented 7 years ago

Ah, I see what I was doing wrong...

Thanks!