Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tyowk/aoi.mysql

Implementation of MySQL in Aoi.js
https://github.com/tyowk/aoi.mysql

aoijs database discord discordjs mysql2

Last synced: about 9 hours ago
JSON representation

Implementation of MySQL in Aoi.js

Awesome Lists containing this project

README

        

Aoi.MySQL






[![NPM downloads](https://img.shields.io/npm/dt/aoi.mysql.svg?color=3182b0&style=for-the-badge)](https://npmjs.org/package/aoi.mysql)  
[![NPM version](http://img.shields.io/npm/v/aoi.mysql.svg?color=3182b0&style=for-the-badge)](http://npmjs.org/package/aoi.mysql)  




Aoi.MySQL makes it simple to connect your Aoi.js Discord bot to a MySQL database. With support for mysql2, you get reliable and fast database operations, perfect for any Aoi.js bot project.



Installation

```bash
npm install aoi.mysql
```



Setup

```js
const { AoiClient } = require('aoi.js');
const { Database } = require('aoi.mysql');

const client = new AoiClient({
token: 'client_token',
prefix: 'client_prefix',
intents: ['Guilds', 'GuildMessages', 'GuildMembers', 'MessageContent'],
events: ['onMessage', 'onInteractionCreate'],
disableAoiDB: true // This is important, ensure it's set to true. You can't use both at once.
});

const db = new Database(client, {
url: 'mysql://...', // your MySQL server uri
tables: ['main']
});

// rest of your index.js..
```