Installing Luvit - Luvit.io there you go open command prompt if you on windows and then direct to the folder of your bot and type PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = 'Tls12'; iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/master/get-lit.ps1'))"
Nah, it is okay now - it has been 2 months lol
Hi there! Great tutorial! Iâve always wanted to create a discord bot! Do you know if there is a way to do this on a Mac? I tried using this tutorial but the commands started being too different to work. Is there by chance a way to do this on Mac?
You could just use webhooks, this isnât needed.
This is just a simple demonstration into being able to code a Discord bot in Lua. Webhooks are different and donât have all the same functionalities that a bot does.
is there a way to script discord bot with lua without luvit?
Yes, however youâd need to utilize Discord.Js or Discord.py for that.
Discord.JS is the best library to use for new bot developers.
Thanks a lot I can now be lazy and only have to learn lua
Yes, the library is much more rich and powerful in terms of the library, functions, a wide range of situations where it can be applicable, and more. Python is definitely a language worth taking into consideration and for some, it is a plan that suitably better works out for them. When considering your first language many users forget to take into perspective that youâre not likely to receive any too much support if you go and try to code a discord application in rust or ruby. The syntax is simple and easy to understand with Javascript much more than Python.
If you wonât be using the bot on many servers then a JSON file you can read or write to would work fine
MySQL would be more efficient even for single server use because of how corruptible JSON files are if something goes wrong.
Hello everyone,
Iâm truemedian, a contributor to Discordia and Luvit.
Iâm aware that this is quite old but I would like to clarify a few things in this thread.
Require Bugs
While this is indeed a bug with luvitâs require, the way you should fix it is by using require with relative paths, such as require('./file.lua')
.
Itâs a known issue and pain point of luvit that we cannot fix because we must maintain backwards compatibility. It exists because luvit actually implements its own require
in order to properly use the deps/
folder created when installing dependencies via lit
. However when it cannot find the library or file you provide it, it falls back upon luaâs require, which doesnât know about the deps/
folder. This action is a one way door, once you leave luvitâs special environment, you cannot re-enter it.
(Scheduled) Coroutines
This is technically incorrect. Luvit simply schedules coroutines with an event loop (exactly how roblox does coroutines, only on single thread) in order to continue doing things that take forever: such as making network requests (we can be doing better things with our time than waiting).
Catching Console Errors
The recommended way to do this is to actually do
luvit bot
pause
The pause
at the end will cause the terminal to remain open until a key is pressed when the bot errors unexpectedly. This is very helpful in catching errors.
This is another way to get a similar output.
Installing Luvit
If youâve seen mentions of SinisterRectus/get-lit
, it was to solve a temporary problem with the luvit installation process and has since been archived and eventually was deleted.
We understand that installing luvit is quite painful or impossible for some users. This could be for a multitude of reasons (often your antivirus). Another issue that has come up for some users is that the luvit project stopped prebuilding ARM Linux luvi binaries (which are required for the luvit installation process).
Because of this I have begun publishing Luvit, Luvi, and Lit binaries for Windows (64-bit), MacOS (64-bit), and Linux (64-bit and ARM).
Other Notes
I am glad to see such a nice beginner tutorial on how to start with a Discordia project. I hope we can continue getting people like this to use, and possibly eventually contribute to the project.
Discordia 3.0 is currently under development, so eventually this guide will be wrong if youâre using the latest version of Discordia. This is just a warning for those reading this in the future. I will try to remember to update this message when the time comes.
What do I do here?
âcmakeâ is not recognized as an internal or external command,
operable program or batch file.
Unless youâre on a system that luvit doesnât have prebuilt binaries for, you shouldnât need to build luvi from source. Building from source requires a system setup for building (git, cmake, perl, and a c compiler in this case).
If you cannot get the installation scripts to work on your system. Please use the prebuilt binaries available here.
thank you, I got it working, just got to familiarise myself with the docs
sorry to be intrusive but can I get your Discord @?
Its Nameless#1814
, but youâre likely to find me in either of the discord servers mentioned in the README.
Ah cripes, I forgot about this thread.
Iâve come a ways since then both with Discordia/Luvit and programming in general so I apologize for that whole thing. If I were to write that post now it would be a lot less⌠terrible.
Are you still looking for help on this topic, if so I can help!