I’d have to look into how their web hosting works for API’s. Currently it’s no issue if it’s just only a bot but I’m not sure it’s usable for web hosting so you might be out of luck there.
okay I redid the glitch server because I did the express server instead of the sqlite one, and now it’s showing this error “{“error”:“Server configuration error: You are not logged in.”}”
Wait, you posted this and told me to use the noblox.js-server, but am I supposed to add noblox.js somehow?
Well, actually there are some ways to still login and bypass / autosolve the captcha. I do not recommend this though because you can easily implement the client sided captcha of roblox on your own website to let users validate their fun captcha token themselves without a bypass.
Is it possible to use functions in the javascript modules when my bot is running in Lua? I’m using the Discordia module to control my bot, but I’d like to be able to control my noblox-js module with Lua (running on Luvit).
I believe he/she meant running Lua not on Roblox, but as an individual program.
@bigcrazycarboy You have a couple of options; you can run both programs and then have some sort of IPC between the two processes, or you could use something like https://fengari.io/ to run Lua in Node.JS (Lua VM).
I’m using Luvit as my VM at the moment, and since that has custom built-in functions it would be hard to switch. To my understanding Luvit is open sourced on github, so if needed I could copy some stuff over, but ultimately I’d like to avoid having to do that.
var discord = require('discord.js');
var roblox = require('noblox.js');
var client = new discord.Client();
var token = "TOKEN_HERE"
var cookie = "COOKIE HERE"
client.login(token)
roblox.cookieLogin(cookie).catch(() => {console.log("Sorry, it failed.");});
client.on("ready", () => {
client.user.setGame(`Making HL3`);
console.log(`Ready to serve on ${client.guilds.size} servers, for ${client.users.size} users.`);
});
client.on('guildMemberAdd', member => {
let guild = member.guild;
let user = member.user
console.log(`${user.tag} joined ${guild}`)
});
client.on('guildMemberRemove', member => {
let guild = member.guild;
let user = member.user
console.log(`${user.tag} left ${guild}`)
});
var prefix = '!';
var groupId = 2750654;
var maximumRank = 20;
function isCommand(command, message){
var command = command.toLowerCase();
var content = message.content.toLowerCase();
return content.startsWith(prefix + command);
}
client.on('message', (message) => {
if (message.author.bot) return; // Dont answer yourself.
var args = message.content.split(/[ ]+/)
if(isCommand('Promote', message)){
var username = args[1]
if (username){
message.channel.send(`Checking ROBLOX for ${username}`)
roblox.getIdFromUsername(username)
.then(function(id){
roblox.getRankInGroup(groupId, id)
.then(function(rank){
if(maximumRank <= rank){
message.channel.send(`${id} is rank ${rank} and not promotable.`)
} else {
message.channel.send(`${id} is rank ${rank} and promotable.`)
roblox.promote(groupId, id)
.then(function(roles){
message.channel.send(`Promoted from ${roles.oldRole.Name} to ${roles.newRole.Name}`)
}).catch(function(err){
message.channel.send("Failed to promote.")
});
}
}).catch(function(err){
message.channel.send("Couldn't get him in the group.")
});
}).catch(function(err){
message.channel.send(`Sorry, but ${username} doesn't exist on ROBLOX.`)
});
} else {
message.channel.send("Please enter a username.")
}
return;
}
if(isCommand('Shout', message)){
const msg = message;
var Moderator = msg.author;
ShoutMessage = args.join(" ");
if (ShoutMessage) {
rbx.shout({group: groupId, message: ShoutMessage}).then(promise => {
MessageEmbed(Moderator, 0X42F47A, 'Sucessfully shouted to the Group!\n\nMessage: `' + ShoutMessage + '`');
})
} else {
MessageEmbed(Moderator, 0XFF5151, 'Please provide a shout message.\n\nUsage: `shout <message>`');
};
function MessageEmbed(Mod1, Color, Description) {
var embed = new Discord.MessageEmbed()
.setAuthor(Mod1.tag, Mod1.displayAvatarURL())
.setColor(Color)
.setDescription(Description);
msg.channel.send({ embed });
}
});```
*NOTE I will Replace this with better code with Handlers etc later.*