MCPcopy Index your code
hub / github.com/aoijs/aoi.js

github.com/aoijs/aoi.js @6.11.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 6.11.1 ↗ · + Follow
432 symbols 4,262 edges 820 files 30 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

aoijs

The most powerful string package to create a simple and fast Discord Bot.


NPM downloads     AoiJS Server     NPM version     License     Website    

Documentation | Support Server | NPM | GitHub


About

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.

Features

  • 600+ Pre-built Functions: aoi.js comes packed with over 600 pre-built functions that empower you to create dynamic and interactive Discord bots with ease.
  • Built-in Custom Local Database: With aoi.js, you get a powerful custom local database out of the box.
  • Extensions for Added Functionality: Enhance your bots capabilities with aoi.js extensions like aoi.music and aoi.panel. These extensions make it simple to add music playback, interactive panels, and more to your bot.
  • Easy-to-Use and Beginner Friendly: aoi.js boasts a user-friendly syntax that is perfect for beginners. The simple $ prefix makes it easy to write commands and get your bot up and running quickly.

Setup

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`
});

Adding Database

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`
});

Command Handler

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.

Notices

  • Reading Functions: Currently it reads $ functions from bottom to top.

Official Extensions

@aoijs/aoi.panel @aoijs/aoi.music

Contributing

Refer to contribution documentation for more information

Extension points exported contracts — how you extend this code

String (Interface)
(no doc)
src/index.d.ts
SetCodeOptions (Interface)
(no doc)
src/index.d.ts
ConsoleMessageData (Interface)
(no doc)
src/index.d.ts
BaseCommand (Interface)
(no doc)
src/index.d.ts
EventCommand (Interface)
(no doc)
src/index.d.ts

Core symbols most depended-on inside this repo

fnError
called by 779
src/classes/AoiError.js
setCode
called by 699
src/classes/Util.js
aoiFunc
called by 696
src/classes/Util.js
error
called by 422
src/index.d.ts
addBrackets
called by 408
src/index.d.ts
get
called by 206
src/classes/Database.js
Interpreter
called by 172
src/core/interpreter.js
getGuild
called by 158
src/classes/Util.js

Shape

Method 250
Function 90
Class 78
Interface 14

Languages

TypeScript100%

Modules by API surface

src/classes/AoiClient.js71 symbols
src/index.d.ts53 symbols
src/classes/Util.js31 symbols
src/events/parsers.js25 symbols
src/classes/Interaction.js23 symbols
src/classes/Variables.js21 symbols
src/core/CheckCondition.js19 symbols
src/core/functions.js18 symbols
src/classes/Functions.js18 symbols
src/classes/Commands.js15 symbols
src/events/slashOption.js14 symbols
src/classes/AoiError.js14 symbols

For agents

$ claude mcp add aoi.js \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact