Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/tyowk/aoi.mysql
- Owner: tyowk
- License: mit
- Created: 2024-07-04T07:29:19.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-24T02:36:50.000Z (about 22 hours ago)
- Last Synced: 2024-09-24T11:30:12.784Z (about 13 hours ago)
- Topics: aoijs, database, discord, discordjs, mysql2
- Language: JavaScript
- Homepage: https://npmjs.com/package/aoi.mysql
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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..
```