pokec-send-message
v1.0.1
Published
Simple wrapper class for sending messages to chatrooms on Pokec social network.
Downloads
4
Maintainers
Readme
pokec-send-message
Simple wrapper class for sending messages to chatrooms on Pokec social network.
This package cannot send RP messages.
Install
$ npm install pokec-send-message
$ yarn add pokec-send-message
Usage
// require lib
const PokecAPI = require("pokec-send-message");
// init lib
const pokec = new PokecAPI();
// get list of pokec chatrooms
pokec.getRooms().then(console.log).catch(console.error);
// login to pokec
pokec.login(
"username",
"password"
).then(response => {
console.log(response);
// send message
pokec.sendMessage(
"hello :)", // message
9, // room id, for list of available rooms use getRooms method
"somebody" // [optional] for user, defaults to "all"
).then(console.log).catch(console.error);
// set interval for ping
setInterval(() => pokec.ping().then(console.log).catch(console.error));
}).catch(console.error);