Skip to content

Solace.js is an alternative to eris and discord.js, a nodejs wrapper for interfacing with discord. Note: Still under development

License

Notifications You must be signed in to change notification settings

solacejs/solace.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solace.js

Solace.js is an alternative to eris and discord.js, a nodejs wrapper for interfacing with discord. The goal of solace.js is to make discord bot development faster. The project structure is sort of similar to discord.js making it easy to move to. With solace.js you can get work done in a faster way.

Installation

npm install solace.js
yarn add solace.js
pnpm add solace.js

Usage

import { Client, Event, GatewayIntents, Registry, SolaceIntents } from "solace.js";
import ReadyEvent from "./events/ReadyEvent";
import MessageCreateEvent from "./events/MessageCreateEvent";

/**
 * You can use intent groups such as SolaceIntents or just use an array of GatewayIntents
**/
const client = new Client({ token: "BOT_TOKEN", intents: SolaceIntents.GENERAL });

const events: Event[] = [];

Registry.registerEvents(client, new ReadyEvent());
Registry.registerEvents(client, new MessageCreateEvent());

client.login();

Ready Event example

import { Client, Event } from "solace.js";

export default class ReadyEvent extends Event {

    constructor() {
        super("ready", true);
    }

    public async execute(client: Client) {
        console.log(client.user!.username, "is online!");
    }
}

MessageCreate Event Example

import { Client, Event, Message } from "solace.js";

export default class MessageCreateEvent extends Event {

    constructor() {
        super("messageCreate", false);
    }

    public async execute(client: Client, message: Message) {
        console.log(message.content);
    }
}

Issues

If something doesn’t work, please file an issue.

Branches and contributions

As this project is intended to be open source and free for everyone to use, feel free to contribute improvements.

If something can be improved, just create a branch from main and make a Pull Request with the suggestions.

Contributors

Meet the talented individuals who have contributed to Solace.js:

About

Solace.js is an alternative to eris and discord.js, a nodejs wrapper for interfacing with discord. Note: Still under development

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published