/DiscordJS-MySQL

An example how to use MySQL in your Discord bot

Primary LanguageJavaScript

DiscordJS and MySQL

In this repository I will show you a quick example of how to use MySQL in your DiscordJS bot. Before you take a look into this repository and don't know how MySQL works, please visit first my other repository where I show how MySQL and NodeJS works: NodeJS-MySQL

Before you asking around and ask yourself questions, pay attention to the following things:

  • You have basic understanding of Javascript
  • You know the DiscordJS library a little bit
  • You have some understanding of SQL queries w3schools
  • You know how a MySQL database works

Packages

For using MySQL in your NodeJS application, you will need the mysql-package and the discord.js-package. You can download these packages with:

npm install mysql

Documentation: https://www.npmjs.com/package/mysql

npm install discord.js

Documentation: https://discord.js.org

MySQL Database

Here is a look how I designed my settings-table in my Database: database design1 database design2