Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Streamilator/streamilator-bot.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MeowerBot.js

Port of MeowerBot.py to Node.js and TypeScript

Installation

npm install meowerbot

Example Bot

import Bot from "meowerbot";

const bot = new Bot(); 

bot.onLogin(() => { // Runs when logged in
    bot.post("Hello from MeowerBot.js!");
});

bot.onCommand("help", (ctx) => { // Runs when a new post with a bot command is sent
    ctx.reply("Commands: @username help");
});

bot.onMessage((data) => { // Runs when the server sends a new message
    console.log(`New message: ${data}`);
});

bot.onClose(() => { // Runs when the bot gets disconnected
    console.log("Disconnected");
    bot.login("username", "password");
});

bot.login("username", "password"); // Init, then login to Meower