aoi.js is a JavaScript library that is designed to make it easy to build Discord bots.
It is open-source and free to use, and provides a simple, easy-to-use interface for interacting with the Discord API and handling events.
aoi.js is suitable for beginners who are new to building bots, as well as experienced developers who want to save time and streamline their workflow.
$
prefix makes it easy to write commands and get your bot up and running quickly.const {AoiClient} = require("aoi.js");
const client = new AoiClient({
intents: ["MessageContent", "Guilds", "GuildMessages"],
events: ["onMessage", "onInteractionCreate"],
prefix: "Discord Bot Prefix",
token: "Discord Bot Token"
});
// Ping Command
client.command({
name: "ping",
code: `Pong! $pingms`
});
const {AoiClient} = require("aoi.js");
const client = new AoiClient({
intents: ["MessageContent", "Guilds", "GuildMessages"],
events: ["onMessage", "onInteractionCreate"],
prefix: "Discord Bot Prefix",
token: "Discord Bot Token",
database: {
type: "aoi.db",
db: require("@aoijs/aoi.db"),
dbType: "KeyValue",
tables: ["main"],
securityKey: "a-32-characters-long-string-here",
}
});
// Ping Command
client.command({
name: "ping",
code: `Pong! $pingms`
});
By default, aoi.js does not have a command handler. However, you can easily add one by using the loadCommands
method.
client.loadCommands("./commands/", true);
./commands/
is the directory where your commands are located.true
allows to log the commands in console.$
functions from bottom to top.