LEGO Universe Discord Bot
Overview
- Prerequisites: what you need prior to setting the bot up
- Setup: instructions on how to set up the bot
- Features: the bots functionality within Discord
- Commands: a short description and example for each command
Prerequisites
-
Create a Discord Application
View the Official Guide on how to create a Discord Application
*Please note that this Discord Bot does not require any special intents
Invite the bot to your server with the following link: https://discord.com/api/oauth2/authorize?client_id={YOUR_BOTS_ID}&permissions=242666032192&scope=applications.commands%20bot
-
Have a LEGO Universe client
You are not required to be hosting a LEGO Universe server to host this bot
All you are required is to have the
locale.xmland thecdclient.sqlitefilesThe
locale.xmlcan be found atPATH_TO_LU_CLIENT\client\locale\locale.xmlThe
cdclient.sqliteis not found in the client. You must create it from thecdclient.fdbwhich is found in unpacked clients.If you are using a packed client, you can unpack just the
cdclient.fdbusing lunpack.exe with the following command:- Make sure the contents of
globs.txtis just*.fdb, otherwise you will unpack the whole client (which takes a lot more time) - Make sure
lunpack.exeandglobs.txtare in the same folder
lunpack.exe "PATH_TO_LU_CLIENT" - g "globs.txt"To convert the
cdclient.fdbto thecdclient.sqlite, upload thecdclient.fdbto https://fdb.lu-dev.net/. - Make sure the contents of
Setup
-
Run
git clone https://github.com/MasterTemple/LEGO-Universe-Discord-Bot.git -
Configuration
Rename
.env.templateto.envand fill in the data from the comments provided.If you do not have a
cdclient.sqlitecreate one from yourcdclient.fdbat https://fdb.lu-dev.net/. -
Install proper dependencies with
npm install -
Transpile with
tsc --buildIf
tscis not found, install it withnpm i typescript -gand then runtsc --build. -
Run
./lib/index.jsI would recommend using something that restarts if it crashes such as pm2
Install pm2 with
npm install pm2 -gand run it withpm2 start .Restart with
pm2 restart alland stop withpm2 stop allIf you edit the cdclient.sqlite or locale.xml, they can be reloaded without restarting the bot by using the Slash Command
/reloadin Discord.If you edit the .env file, you just need to restart the bot.
Features
Autocomplete
This allows users to search objects by their name instead of relying on knowing the internal object id.

Message Embeds
Message embeds allow for organizing and displaying data in a much more visually appealing way.
They are indicated below by the colored bar on the left and the darker background.
Normal Message
Message Embed
Message Components
Message components are the buttons underneath the embed. These allow for the user to execute related commands on an object.
For example, an item that can be earned can also be bought. Instead of having to use /earn and then /buy, the user can use /earn and then click the Buy button.
The green button indicates the current command. Disabled/faded buttons show that an item cannot be obtained through a certain method.
If the user clicks the Buy button, the message is edited to display the following
Paging
The current page index is indicated between the parenthesis in the title.
Page navigation can be controlled through the buttons on the bottom.
External Links
The blue hyper-linked text will take the user to the corresponding page of hosted LU Explorer that is specified in the configuration.
LU Explorer an angular.io webapp that displays LEGO Universe game data..
Commands
/activity
View the stats of an achievement!
/activity
View all rewards given from an activity!
/drop
View all smashables that drop an item!
/get
View how to get an item!
/mission
View the stats of a mission!
/reload
Reload the data from the cdclient.sqlite and locale.xml!
/skillitems
View all items that have a skill!
/vendor
View all items sold from a vendor!
/brick
View the stats of a brick!
/earn
View all missions that reward an item!
/item
View the stats of an item!
/npc
View all missions from an NPC!
/report
Open a dialog to report anything about this bot!
/skills
View all skills attached to an item!
/buy
View all vendors that sell an item!
/enemy
View the stats of an enemy!
/level
View stats about a level in LEGO Universe!
/package
View all items given from a package!
/reward
View all activities that drop an item!
/smash
View all enemys given from a package!
/cooldowngroup
View the skills in a cooldowngroup!
/execute
Open a dialog to execute multiple commands on this bot!
/loottable
View all items in a loot table!
/preconditions
View the preconditions to use an item!
/skill
View the stats of a skill!
/unpack
View all packages that drop an item!





























