sentanos / roblox-js

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

Errors I Get #65

Closed jech1854 closed 6 years ago

jech1854 commented 6 years ago

I Get these errors when running the setRank function. Am i calling the Arguments in the correct order or am i missing one https://gyazo.com/b3c832e231cb873142da3fedb4ed75d4

sentanos commented 6 years ago

You need to post the actual code...

On Nov 1, 2017, at 03:29, jech1854 notifications@github.com wrote:

I Get these errors when running the setRank function. Am i calling the Arguments in the correct order or am i missing one https://gyazo.com/b3c832e231cb873142da3fedb4ed75d4

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

jech1854 commented 6 years ago

const botSettings = require("./botsettings.json"); const Discord = require("discord.js"); const bot = new Discord.Client(); const PREFIX = botSettings.prefix; var rbx = require('roblox-js'); var username = ''; var password = ''; var group = 3054848;

rbx.login(username, password)

bot.on("ready", () =>{ console.log("bot logged in"); bot.user.setGame(${botSettings.prefix}help | ${bot.guilds.size} servers); });

bot.on("message", function (message) { if (message.author.equals(bot.user)) return;

if (!message.content.startsWith(PREFIX)) return;

var args = message.content.substring(PREFIX.length).split(" ")
var newver;

if (args[0] === 'ping'){
    message.channel.send('Pong!');
}
else if (args[0] === 'shout'){
    newver = message.content.slice(7,message.content.length);
    Shout(newver);
    message.reply('Shouted ' + newver);
}
else if (args[0]=== 'rank'){
    target = args[2];// passed as player usename(string)
    rank = args[3];// passed as roleset id/role name
    rbx.setRank(
        3054848,
        args[2],
        args[3]
    );
}

});

function Shout(text){ rbx.shout(group,text); };

bot.login(botSettings.token);

nishi7409 commented 6 years ago

This issue isn't related to the roblox-js library; it has an issue to do your code (Discord.js related).

Join this guild for support in regards to the Discord.js library - https://discord.gg/bRCvFy9

jech1854 commented 6 years ago

Got it working