Skip to content
xHelixStorm edited this page Aug 3, 2018 · 9 revisions

This is an easy tutorial on how to set up the MySQL Server on windows while explaining the use and purpose of every table from each database.

Install MySQL Server on windows with Xampp

Download Xampp from www.apachefriends.org. While installing, the required features of Xampp are apache and mysql. The rest can be unchecked and are not needed for the Bot. After the installation, start the Xampp application and start the apache and mysql process. Thereafter open any browser you prefer and type localhost/phpmyadmin into the upper url field. This is the direct access to your MySQL database over phpmyadmin.

Create the required databases

Now it's time to create our databases. Click on create new database to create the database called Azrael. Then repeat this step two more times for the databases DiscordRoles and RankingSystem. After that import the sql files from inside the mysql folder into the newly created databases with the button called Import after having clicked on a created database.

Table explanations

At this point, the purpose of each imported table will be explained.

Azrael

  • action_log: This table starts empty. If the ActionLog in the config.ini file is true, it will log all actions such as users who got muted, kicked, banned, joined the server, renamed itself or when the user received a nickname. This log will be mainly used by the administrators to keep track of users by checking the database directly or through an integrated bot command.
  • bancollect: This table starts empty. It will contain all users who will get muted with the timestamp of action and with another timestamp of when the user affected gets unmuted. Mostly useful for cases when the Bot has to reboot while someone is muted. In these cases, the bot checks for users who currently have the mute role and compares it to the database to restart the unmute timer and then unmute.
  • bans: This table contains two entries. Id number 1 for not banned and id number 2 for banned. It's useful to differentiate banned from not banned players in the bancollect table.
  • channels: This table starts empty. It will contain all channel names with their id numbers. It can be either filled manually or through a command. Currently, there's no implementation yet that will fill thos table automatically.
  • channeltypes: This table contains all possible channel configuration settings one channel can have. For example a channel can be set to specify an english channel or that it's a bot channel. This table is only for displaying all available types.
  • channel_conf: This table starts empty. Once a channel has been assigned a role through a command, it will be displayed in this table. Here the administrator can see which is the bot channel, the log channel and much more.
  • channel_filter: This table starts empty. After having used a specific command, every textchannel with an assigned filter language will be displayed here. To one channel multiple filters can be assigned.
  • commands: This table starts empty. The administrator can define, if the pug and meow commands should be disabled, only be used in a bot channel or on all channels.
  • commandexecution: This table displays all options for the commands table.
  • filter: This table starts empty. It will contain all possible words that will get filtered upon writing on a textchannel, if the language of the word fits with the configured textchannel language in the channel_conf table.
  • filter_languages: Displays all available languages for the word filter that can be inserted into the filter table.
  • guild: This table starts empty. It will fill with the guild name and guild id of every server where the bot is being used. Letting the bot leave the server won't remove the entry, since it could cause relational issues with other table.
  • names: This table starts empty. It will contain all names that a user will get assigned randomly after that a user triggered the name filter.
  • name-filter: This table starts empty. It will contain all words that will be used to search in names to trigger the name filter after a user joins a server or tries to rename itself. This feature can be disabled or enabled in the config.ini file.
  • nickname: This table starts empty. Every time a user receives a nickname, it can be seen on that table. Useful for users that got a nickname assigned due to the bad name filter. Removing the nickname on Discord, will result in removal of the entry also on this table.
  • users: Contains all usernames and id numbers of users. It will be filled automatically when a new user joins the server or if the bot has been implemented in a later stage, it should be filled with a command. If users are missing on this table, then most of other tables won't work as expected.
  • warnings: This table starts empty. It will display the total number of mutes with the time in milliseconds to when the mute will be lifted. If this table is empty, the bancollect table can't receive any entries and muted users will be unmuted instantly. The table can be filled either manually or by the recommended way, through a command.

RankingSystem

This tables get used only, if the ranking system has been enabled with a command.

  • dailies_usage: This table starts empty. It will be filled with a user id, the time of action and the time of when it can be redone after a user utilizes the daily command. It has been set that the next_daily time equals the midnight time of the next day.
  • dailies_experience: This table starts empty. If the daily experience limit command have been used to enable this feature, it will collect all users in this table until the limit of experience points have been reached. Those experience points get resetted to zero once a day at midnight.
  • daily_items: This table starts empty. It will be filled after a command has been used. The description is the name of the item, the available types are currently cur for currency and exp for experience. The action field means what should happen after an item has been won from the dailies. If it's use, the item will be activated without moving it to inventory. More action types will follow in the future.
  • daily_type: This table currently contains only two kinds of daily items. Either currency items or experience items.
  • experience_bar: The profile and rank commands got a lot of skins and hence different types of experience bars. In this table, all available experience bars are displayed.
  • guilds: This table starts empty. It will contain all servers with an enabled ranking system. Other than that, it will display the cap level for each server and the default skins for the profile and rank command as well as during a level up.
  • inventory: This table starts empty. Once a user purchases an item or skin from the shop, it will be displayed in this table together with the timestamp of action and the number of times the user has obtained it. With the status it can be defined, if it's a temporary item or a permanent item. If it's a temporary item, the expires field will be filled with a timestamp.
  • item_status: In this table the parameters limit and perm are displayed. Those are used by the inventory table.
  • max_exp: This table starts empty. Here can be defined either by command or manually what the experience limit for each day should be and to enable or disable it.
  • ranking_icons This table contains all available icons for the ranking system. Those icons can be seen as levels that a user has reached in pictures.
  • ranking_level: This table contains all available level up skins for the ranking system with the text color in RGB and the avatar size and location where it should be drawn on the background.
  • ranking_profile: This table contains all available profile skins for the ranking system with the same information as the ranking_level table, except that you can also decide if text should be displayed beneath the experience bar and which bar template color should be used for that skin.
  • ranking_rank: This table contains all available rank skins for the ranking sytem with the same information as the ranking_profile table.
  • roles: This table starts empty. It will contain all role names with their id numbers and a level requirement to unlock that role that can be filled with a command. Once a higher level requirement has been reached, the role with a lower level requirement will be automatically removed.
  • shop-content: This table contains all available items in the shop, with their prize and their item category that can be displayed by using the shop command.
  • skin_type: This table contains all available item types for the shop-content table.
  • users: This table starts empty. After enabling the ranking system, all users should be registered via command into the table. This table will then contain all users with their current skins that they are using.
  • user-details: This table starts empty. This table will contain information of a user such as the current level of the user, the current experience points, the rank up experience points that are needed to level up, the total collected experience points, the owning currency and the last unlocked role id. The role id will be used to re assign the user with that role in case the user leaves and rejoins the server or got muted.
  • user-guild: This table starts empty. This table will be used to disolay all servers where a user is in and where the Bot is in. Will be used to keep the gained level on all servere where the Bot is active. It will be filled automatically when a user joins the guild or when all users get registered.

DiscordRoles

  • guilds: This table starts empty. It will be filled automatically when the Bot joins a server while running. It will contain the server name and the server id.
  • roles: This table starts empty. It will contain roles of one or multiple servers with a specific hierarchic role. For example administrator, moderator, bot and so on. It's also possible to set a mute role. It can be either filled manually or by command.
  • role_category: This table contains all possible categories for a role being registered for the roles table.
Clone this wiki locally