Creating A Discord Bot With Lua

Pretty sure you can. Are you sure that you can’t install it on raspberry pi?

Hey! I have a question, does this tutorial work on mac?

If anyone is worried about bandwidth, without image uploading, one of my bots i run generally has about 4mbps download and 1mbps upload being used on average at any given time (mega bits), and that’s with 16,000+ guilds, you’re basically looking at barely any bandwidth usage.

2 Likes

I basically just explain what discordia is, what luvit is, how to create a discord bot with it using Lua and so on in this topic. It should be the exact same thing with Mac, except the installation, which may be a bit different. Installing Luvit - Luvit.io here is the installation link, if you are having troubles throughout the installation then here are the installed luvit files: https://vamik64.ml/dump/Luvit.zip. Should work for Mac too.

If you install luvit and pm2 on a VPS you can append pm2 doing --interpreter=LUVITPATH The command would look like. pm2 start BOTFILE --interpreter=LUVITPATH However, there is no use using pm2 unless you have a VPS.

Yay, hope I can start getting into making a Discord bot.

1 Like

Discordia is great.
I’ve been using it alot, it’s pretty interesting. If you get right into it, you can make almost anything, of course, Discord JS is still more powerful, but if you have no clue about JavaScript and you want to make an custom bot, then this is the best thing to use.

2 Likes

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 : /