Creating A Discord Bot With Lua

If I was making a bot with, for example, an inventory system (just strings), how would I save this data for each user?

1 Like

You would need a third party database to do that.

1 Like

Thought so. Any cheap options?

1 Like

I’ve never needed to use a third party database to be honest, you could ask a web developer regarding your question. But if you are making a small bot for fun to store data which is not that big you could use https://www.jsonstore.io/.

1 Like

Yup, just a small bot. How would I go about implementing this? Sorry about asking so many questions.

1 Like

Someone has actually made a module using Lua which makes communication with jsonstore.io easier. Here is the link to the thread. Jsonstore.io Module hope you find it helpful :slight_smile:.

2 Likes

Thank you! I’ll play around with this.

1 Like

I’m actually using discordia for my discord bot for my game Midnight Racing Tokyo. There is a private channel where the game sends webhook messages and the bot can automatically give roles and stuff. There’s also a fun event I coded that will log all the discord nitro boosters and give them a free car in game (this is in progress but I’m sure it’s going to work). I think the possibilities of discord bots in roblox are underrated :stuck_out_tongue:

Using the bot with RoVer API is actually very beneficial to me, as it lets me link discord members with roblox players. That way I can give people perks in game based on things they do outside of the game, or give them promotional roles in the discord based on things they do in the game (Like reaching 500 laps or a certain amount of playtime or something.)

I can’t install Luvit and the link you provided for the zip file does not open

not sure what to do here…

When I click on the link, the connection resets and it does not works.

1 Like

Made my bot it’s called “Tsuki” which mean moon in Japanese. (Lua means moon in Portuguese)

But I have no idea how I’m supposed to host it using a VPS.
Can someone show me how.

6 Likes

Nice tutorial! Javascript is still far superior for discord bots than any other programming language, such as Python and Lua, however, for those who are good with Lua and don’t want to learn a new programming language, this is good.

1 Like

The link to get the luvit zip is dead @valchip : /

this really turned tedious to be honest. I still cannot install luvit and I have to get some sort of compiler and other apps and such. I hope there is an easier way to set this up. Because for now its a headache to do so.

1 Like

Yeah it’s pretty inconvenient and I dont recommend it instead you can use discord.py or discord.js. It’s way better and convenient. I am not really good at python but was able to male a decent bot with many commands within just a week.

1 Like

I installed Luvit properly, and it seems people are having trouble with downloading Luvit, so I uploaded my version of Luvit to the devforum, so you won’t need to do any of that, just unzip and you have deps, and the 3 Luvit executables, it also comes pre-installed with discordia, here’s the download link: Download Link

4 Likes

Hey so I found an error while trying to run a script
[string “REPL”]:1: ‘=’ expected near ‘bot’

It works pretty fine, also the pcall is kinda messed up, by returning true during an error.

I keep having something blocking luvit.

I have no idea why it’s doing this, I tried disabling different parts of McAfee…
Anybody have a solution?

I am confused on how to install luvit :frowning: