0.2.44 • Published 4 years ago
ggclient v0.2.44
GGClient - API for gg.pl
GGClient is created and (possibly) maintained for the purposes of the GGBot project.
Usage
Setup
const ggclient = require('ggclient').GGClient;
const puppeteer = require('puppeteer');
// OR
import {GGClient} from "ggclient";
import puppeteer from "puppeteer";
(async () => {
const browser = await puppeteer.launch({
headless: true, // show the browser for debug purposes
args: ["--mute-audio"] // mute chromium on startup
});
const client = await ggclient.launch(browser, userNumber, userPassword);
})
Send message
client.sendMessage(66666666, "Hello!");
Listen to messages
message.time is UNIX epoch in seconds
client.onMessageReceived = (message) => {
console.log(message.sender, message.time, message.message);
}
By Vlop