Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Latest commit

 

History

History
74 lines (54 loc) · 2.64 KB

README.md

File metadata and controls

74 lines (54 loc) · 2.64 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!


Warning

This repository has been moved to The nin0chat organization and will no longer be maintained here. Please go to the new repository for the latest updates.

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 install jsr:@kodarru/callisto

Usage 📚

Here is a simple example of how to use Callisto:

import { Client, Callisto } from "@kodarru/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.