Databases - GlaubeKeinemDev/JDA-Utilities GitHub Wiki

This bot brings a full automated file-based database system with it. It is a simple key, value based system. You can add Objects by calling DataBase#append("Key", myObject);

NOTE: Make sure you have enabled the database system first. Read Getting started to figure out how do you enable it.

How to create a new database and write a string into it:

    final DataBase dataBase = discordBot.getDataBaseManager().createDataBase("TestDataBase");

    dataBase.append("MyDataBaseTest", "Hello");

    discordBot.getDataBaseManager().saveDataBase("TestDataBase");

Get the string from the Database is not very difficult:

    discordBot.getDataBaseManager().getDataBase("TestDataBase").getString("MyDataBaseTest");

How the file will be look like:

{ "dataBaseEntry": { "MyDataBaseTest": "Hello" } }