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.
npm install ch.api.js
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
});
Telegram Support Server
Discord Support Server
Revolt Support Server