Database

What is a database?
Data is stored in a database. Specifically, one can define: A database is a logically connected collection of data that describes a section of the real world. It does not matter how the information is stored. What kind of data is involved is initially not of interest.

In contrast to variables, the bot can create, delete and change databases itself. This can be very useful with more complex codes, especially if you want to replace individual storage locations for each server or user.

How do you/the bot create a database?
Everything you need for the databases can be found in the database category. This has been divided into two parts: reading something from the database and changing something in the database.

Update databse
With the blocks in the "Update databse" area you can create, delete and change the value of the databases. To create a database, use the "set to  in database" block. In the first field you put the name of the database and in the second field the value. What the name is is up to you. You can specify something for the bot and enter a name directly using the built-in text field, or let the bot name the database itself using, for example, the ID of the message author.

You don't have to use the text field, you can also insert other blocks.

To delete a database you use the "delete from databse" block. In the field you enter the name of the database you want to delete. Then the database will be deleted, i.e. the name and the stored values are gone. It is impossible to retrieve it after the deletion. It must be recreated and given a new value.

With the lower two blocks, you can change the value of an already existing database. This is done here in numbers. Important: with these blocks you change the database. For example, if the database is set to 1 and you change the database by 3 with the help of this block, the database will then be set to 4. If you use the "set to  in database" block. This means that the old value is overwritten. For example, if the database is set to 1 and you set the database to 3, the database is then set to 3!

Read database
With these blocks in the upper part of the category you can check if and what is in a certain database.