Aeracord

Aeracord is a lightweight library for the Discord API with flexible caching.

src/index.js

import { ACTIVITY_TYPE_PLAYING, Client, INTERACTION_RESPONSE_TYPE_MESSAGE } from "aeracord";

// Create client
const client = new Client({
    token: process.env.TOKEN,
    presence: {
        activities: [{
            name: "say /help",
            type: ACTIVITY_TYPE_PLAYING
        }]
    },
    membersIntent: true
});

client.on("ready", () => {

    // Log
    console.log("Bot online");
});

client.on("interactionCreate", (data, { interaction }) => {

    // Ping
    if (interaction.data.name === "ping") {

        // Respond
        interaction.respond({
            type: INTERACTION_RESPONSE_TYPE_MESSAGE,
            data: {
                content: "Pong!"
            }
        });
    }
});

Flexible Caching

Aeracord aims to be flexible with what gets cached. Control not only what gets cached, but also how long objects stay cached, and when they should automatically be cached.

Learn more

Caching Objects
Flexible caching

Object Oriented

Aeracord has object-oriented classes to allow for making simple and logical calls to the Discord API. However, lower-level methods are also available, making Aeracord flexible based on what data is available.

Learn more

Documentation
Object oriented

Interactions

Aeracord has support for interactions, AKA slash commands. You can manage your bot's slash commands as well as respond to them with the interactionCreate event.

Learn more

Interactions
Interactions