Setup Guide - vizyks/lucid GitHub Wiki
[!WARNING]
Currently this guide is mainly for Linux and if following using Windows, some installation methods will be different.
Introduction
This guide will cover the basics of setting up Lucid for your own personal use. If your following the guide using Windows, the installation methods for Node, FFMPEG, might be different and is currently not covered in detail, other than that the rest of the sections will be follow-able no matter the OS. This guide will also NOT cover how to change in-depth parts of the bot or add things to the bot (ex. commands, support for multiple servers, etc).
Node
First this bot runs on Node, therefore we need to install it and its requirements first.
Before installing node lets check if node is already installed, if the output shows a node version then you can proceed to the end of the node section to update and use the proper node version for the bot to work properly.
# Check current node version
node -v
Node Setup is a perfect way to install these requirements for Linux, Windows, or MacOS.
[!WARNING]
Lucid and its dependencies require a Node version of 18.17 or higher.
If you accidentally install the wrong node version you can easily correct it by (replace NVM with FNM if using FNM)
# Install correct node version, can be 18.17.0 or higher
nvm install 18.17.0
# Set nvm to use the correct node version (replace 18.17.0 with the version you installed if different)
nvm use 18.17.0
FFmpeg
Second installing FFmpeg is pretty straightforward, depending on your operating system, Linux dist and or package manager, installing FFmpeg will differ in the methods of installation but all should be fairly similar and simple. The examples below will be using the "apt" package manager that is from Debian derived Linux dist (ex. Ubuntu)
Its first a good idea to update and upgrade your current packages if not done recently.
[!WARNING]
If system hasn't been updated recently it might not be able find the FFmpeg packages that needs to be installed.
# Update and upgrade your system replacing "apt" with the package manager from your own Linux dist.
sudo apt update && sudo apt upgrade
# Finally just install ffmpeg
sudo apt install ffmpeg
Bot Files
Third, now that we have Node and its correct version installed, we now can grab the lucid files from the github. You can either just download the respository as a ZIP file and then extract the files, or if you intend to do version control and edit/change or add to the bot you can run. If you need additional help or get stuck, you can follow this official help guide from GitHub themselves here.
# Navigate to the directory you want the files in ex. /home/{user}/repos
# Clone the repository
ssh clone [email protected]:josephdorman/lucid.git
And with that you should now have the bot files on your own system.
WIP (update packages/download req in the bot files)
Creating the App on Discord
[!CAUTION]
NEVER show or share your Bots, Token, APP ID, Public Key, Client ID or any secrets regarding your bot publicly EVER. Doing so will put your bot or even you at risk of being exploited or worse.
Fourth, we are now going to create the bot app in discord itself so it can be invited to your own server and so its API code can be used in the bot files you just downloaded to connect the two. There will be two versions of this guide, a fast guide, and a more detailed in-depth guide that can be found here.
- Login to Discord, go to advanced settings, enable developer mode, then click on discord api link in the setting desc.
- Navigate to applications at the top left, then click new application at the top right.
- Give the bot a name and click create.
- Go to Bot settings and scroll to "Privileged Gateway Intents" section and turn on "Message Content Intent"
- Go to the OAuth2 settings of the bot and check the "bot" box.
- A new window will appear below it and check "Administrator" box.
- Bottom of the page will have a URL, paste that URL into the browser.
- Then finally select the server you want the bot to join.
Connecting Discord App to Bot Files.
[!CAUTION]
Just like the section above, this will deal with the bots secrets like the Token, App ID. NEVER SHARE THESE SECRETS.
Fifth we need to finally link the Discord App we made and the Bot Files we downloaded. Just like the section above there will be a fast guide, and a more detailed in-depth guide with pictures to help if you get stuck and can be found here (also located at the bottom of the previous guide).
- Go to the directory of where you downloaded the bot files.
- In the bot files create an additional file called ".env".
- Open it up with Notepad or code editor.
- Copy the following into the file.
img
- Click on the "General Information" setting and scroll to "application ID".
- Click the copy button and paste it in the file where it says APP_ID.
- Go to the bots settings and click the "Bot" tab.
- Scroll down to the section called "Token".
- Click "Reset Token" and copy and paste it in the file where it says BOT_TOKEN.
- Go to the discord server where you added the bot to
- Right click the server name at the top left and click "Copy Server ID".
- Paste the server id into the file where is says GUILD_ID.
- Save the file then you can close it.
Now we have officially linked the bot files and the discord app together.
Hosting the Bot
WIP