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: