Environment Setup
This guide will provide a brief overview on how to setup both the Lune runtime as well as several tools that will help you in development of a DiscordLuau application.
This guide requires no prerequisite knowledge, and aims to get you up to speed, regardless of your background as a developer.
Required
The following tools are typically required for a development environment to build a DiscordLuau application:
Visual Studio Code
Visual Studio Code is a commonly used code editor that DiscordLuau assumes you’ll be using, there will be several references to VSCode, or branches alike VSCode in this guide.
You can get VSCode here.
To continue, create a new directory for project, and have opened that in VSCode.
Rokit
Rokit is a toolchain manager, enabling developers to easily download and setup project tooling.
This guide assumes that you’re using Rokit, however, you are free to use other installation methods or toolchain managers.
Please follow these steps to install Rokit.
Now, run the following command to set up your current working directory with Rokit:
Luau LSP
Luau LSP is a language server protocol implementation for the Luau programming language. It allows for autocomplete, code analysis, and other nice-to-have features in your IDE.
Install the extension from the VSCode Marketplace or OpenVSX Registry:
- VSCode Marketplace: https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.luau-lsp
- OpenVSX Registry: https://open-vsx.org/extension/JohnnyMorganz/luau-lsp
For other IDEs, instructions may be located here.
Lune
Lune is a Luau runtime, enabling us to execute our code. Lune makes it possible to utilize various I/O functionality via its standard library.
To learn more about Lune, its standard library, and installation instructions, please read the documentation
Installing Lune can be done so through Rokit as such:
To verify that Lune has installed correctly, you can execute the following command in your terminal to display your installed Lune version:
Git
Git is primarily a version control system, platforms such as GitHub and GitLab allow you to publish your code as repositories.
Install it by following this guide.
Optional
The following tools are nice-to-haves, but by all means can be skipped and/or ignored.
Selene
Selene is a Linter for Luau code, and is generally a healthy tool to use to determine poor quality code in your project.
Using Rokit, it can be installed by running:
StyLua
StyLua is an opinionated code formatter for Luau projects, which formats your code to be easily readable.
To install StyLua, follow this guide.
Using Rokit, this would look like:
Conclusion
You now have the tools to start developing a Discord application using DiscordLuau!
The following is a rokit.toml
file containing all of the above tools, you can compare what you have to this to ensure everything
is correctly installed! Do note that this contains the latest versions of the tools at the time of writing this guide, and these versions may change in the future.
Additionally, you should also have the following applications avaliable in the command line:
and finally, you’ve installed a code editor/IDE, such as Visual Studio Code!