Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 2.44 KB

README.md

File metadata and controls

71 lines (52 loc) · 2.44 KB

Callisto 🌙


This is what I think Callisto would look like. Made using Deno's Dinosaur Creator.

Check out Releases.md for more information on v0.1.1!


Callisto (getting it's name from Jupiter's second largest moon) is a simple, easy-to-use, and powerful Deno V2 library for creating and managing nin0chat bots. It only uses the ws library, everything else is built from scratch.

Installation 📦

The installation is very simple, just run the following command in your terminal:

deno add jsr:@nin0chat/callisto

Usage 📚

Here is a simple example of how to use Callisto:

import { Client, Callisto } from "@nin0chat/callisto";

const client = new Client({
    Bot: {
        username: "YOUR_BOT_NAME",
        key: "YOUR_BOT_KEY",
        staleMessages: [],
    },
    Websocket: {
        URI: "wss://guhws.nin0.dev", // If you're using a different server, change this.
        Reconnect: true,
        ReconnectMaxTrials: 5,
    },
    LogLevel: 2,
});

const Log = client.Logger;

// This event is called when the bot connects to the server.
client.On("open", () => {
    Log.Info("Connected to the server!");
    client.Send("Hello, world!");
});

// This event is called when the bot receives a message.
client.On("message", (message: Callisto.Message) => {
    // This is a simple example of how to check if the message is from a bot.
    if (message.isBot()) return;

    Log.Info("New message! " + message.content + " - " + message.username);
});

// Always put this at the end of your code (after you've registered all your events).
client.Connect();

Was this not enough? It's okay! We have a more in-depth example here.

Documentation 📖

The documentation for Callisto can be found here. There will be no documentation as of yet until the nin0chat rewrite is complete. Check out the example or look at the JSDoc comments in the source code.

License 📜

This project is licensed under the GNU General Public License v3.0. You can find the license here.