Skip to content

Getting Started

Welcome! This guide assumes you have a basic understanding of aoi.js. It also assumes you defined your AoiClient as client

Installation

Terminal window
npm i aoi.mysql

Setup

1
// Import packages
2
const { AoiClient } = require("aoi.js");
3
const { Database } = require("aoi.mysql");
4
5
// Aoi.js client
6
const client = new AoiClient({
7
token: 'TOKEN',
8
prefix: 'PREFIX',
9
intents: ['Guilds', 'GuildMessages', 'GuildMembers', 'MessageContent'],
10
events: ['onMessage', 'onInteractionCreate'],
11
disableAoiDB: true // ⚠️ THIS IS IMPORTANT, ensure it's set to true. You can't use both at once.
12
});
13
14
new Database(client, {
15
url: 'mysql://...', // YOUR MYSQL SERVER URI
16
tables: ['main']
17
});
18
19
client.variables({
20
key: 'value' // ⚠️ THIS IS IMPORTANT, you need to place this client variables under database settings.
21
});
22
23
24
25
• • •

Aoi.DB

Want to backup your aoi.db database? or transfer your aoi.db database? 🤚 NOT POSSIBLE YET!