A client for parsing chaturbate-browser events.
The events are published from the chaturbate-browser module. This module transforms those events into objects that are easier to handle.
Note: this module stores no state. See chaturbate-controller for handling state.
npm install @paulallen87/chaturbate-events
const browser = new ChaturbateBrowser();
const events = new ChaturbateEvents(browser);
events.on('room_message', (e) => {
console.log(`${e.user.username}: ${e.message}`);
})
events.on('tip', (e) => {
console.log(`${e.user.username} tipped ${e.amount} tokens`);
})
await browser.start();
browser.profile('<username>');
setTimeout(() => browser.stop(), 10 * 1000);
Called when the browser hook is initialized.
Called when the actual web socket is open.
Called when the actual websocket has an error.
Called when the actual web socket is closed.
Called when the Chaturbate app needs to log an error message.
- message (string)
Called when a notice needs to be posted to viewers.
- messages (Array)
- foreground (string)
- weight (string)
- background (string)
- to (?string)
Called when you apps/bots tab needs to be refreshed.
Called when "the broadcaster is away" has been canceled.
Called when the host removes the current app.
Called when the broadcaster has approved a group show.
- tokensPerMinute (number)
Called when a group show has been canceled.
Called when a viewer requests a group show.
- usersWaiting (number)
- usersRequired (number)
- tokensPerMinute (number)
hidden_show_approve
Called when a nidden show is approved.
- initialHideCam (?)
Called when YOU join the room.
Called when YOU join a private room.
Called when a viewer is kicked from the room.
- username (string)
Called when a user leaves a private room.
- username (string)
Called when YOU leave the room.
Called when the app wants to log a message.
- message (string)
???
- subject (string)
Called when YOU have been kicked from the room
- reason (string)
Called when you receive a private message
- tabNick (string)
- user (UserObject)
- message (string)
Called when a private show is approved.
- tokensPerMinute (number)
Called when a private show is canceled.
Called when a private show is requested.
- requesterUsername (string)
- tokensPerMinute (number)
Called when a user has been promoted to moderator.
- toNick (string)
- fromNick (string)
Called when an item has been purchased.
- message (string)
Called then YOU receive a tip.
- amount (number)
- fromUsername (string)
- toUsername (string)
- message (string)
- history (boolean)
Called when the "goal" panel needs to be refreshed.
Called when moderator privs have been revoked.
- toNick (string)
- fromNick (string)
Called when the room count is updated.
- count (number)
Called when someone enters the room.
- user (UserObject)
Called when someone leaves the room
- user (UserObject)
Called when a new user message was received by the room.
- message (string)
- user (UserObject)
Called when YOU successfully sent a kick message.
Called when YOU succesfully send a private message.
Called when you successfully send a room message.
Called when the room settings have been changed.
- allowPrivates (boolean)
- allowGroups (boolean)
- minimumUsersForGroupShow (number)
- privatePrice (number)
- groupPrice (number)
- spyPrice (number)
Called when a viewer has been silenced.
- silencedNick (string)
- silencerNick (string)
Called when a tip was received.
- amount (number)
- user (UserObject)
Called when the room title has changed.
- title (string)
- showInChat (boolean)
???
- usernames (string) - comma separated
- tokenAmounts (Array) - comma separated
This object represents a chatroom user.
- username (string)
- isMod (boolean)
- inFanclub (boolean)
- tippedTonsRecently (boolean)
- tippedAlotRecently (boolean)
- tippedTecently (boolean)
- hasTokens (boolean)
- gender (string)
- fontColor (string)
- fontFamily (string)
npm test