ch.api.js

1.3.6 • Public • Published

ch.api.js

Chat Application Programming Interface, or ch.api.js, is a package built to connect chat applications. Think of it as Discord.js, but built to work not only on Discord, but Revolt, Telegram, and more.

Installation

npm install ch.api.js

Example Usage

const { Client } = require("ch.api.js");
const config = require("./config.json");

// Create the ch.api client with a prefix.
const client = new Client({
    prefix: "ch."
});

// The "ready" event is called whenever a client is ready.
// This means that it gets called once for Discord, once for Revolt, once for Telegram, etc.
client.on("ready", (client) => {
    console.log(`Logged into ${client.name.toUpperCase()}!`);
});

// The "message" even is called whenever a message is recieved.
client.on("message", async (message, client) => {
    console.log(`${client.name} message: ${message.author.username} said "${message.content}"`);
});

// This logs into any clients that have a token supplied.
client.login({
    telegramToken: config.tokens.telegram,
    discordToken: config.tokens.discord,
    revoltToken: config.tokens.revolt
});

Support

Support Server Invites

Telegram Support Server
Discord Support Server
Revolt Support Server

Bot Invites

Telegram Bot Invite
Discord Bot Invite
Revolt Bot Invite

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ch.api.js

    Weekly Downloads

    0

    Version

    1.3.6

    License

    ISC

    Unpacked Size

    56.7 kB

    Total Files

    14

    Last publish

    Collaborators

    • so_fi