|
No-frills event-reporting
Remember to type “/debug” into chat to see log entries.
Design (C) 2023 E M Drayton for Eleventh Intake Ltd UK (SC505619)
JavaScript (C) 2023 CC-BY-SA
This is a Chaturbate bot (to API v1) intended for monitoring (and debugging) other apps and bots. The level of log detail (see below) is owner-initialized at startup (ie from cb.settings_choices).
Each of the twelve API v1 events has been assigned a single UPPERCASE letter, derived from the corresponding API v1 function names; in alphabetical order, these are:-
B = onBroadcastStart --- the owner began broadcasting
D = onDrawPanel --- (for app to devise a 270x69 panel)
E = onEnter --- a user entered the room
F = onFollow --- a user followed the owner
J = onFanclubJoin --- a user paid to join the owner's fan club
L = onLeave --- a user left the room
M = onMessage --- a user messaged without tipping
P = onMediaPurchase --- a user paid for a pic/vid/link/whatever
Q = onBroadcastStop --- the owner quit broadcasting
S = onStart --- the owner started a bot (or app)
T = onTip --- a user tipped (usually messaging, too)
U = onUnFollow --- a user stopped following the owner
Events can be logged, or notified, or both. Logged events are only seen if the room owner types '/debug' into the chat; notifications are always seen. By default all eleven of the twelve bot-reportable events are both logged and notified (NB: bots cannot observe DrawPanel events); this is controlled by removing the appropriate letter from the two letter-sequence(s) on start-up, thereby suppressing reporting.
NB: onMediaPurchase() differs from onMessage() and onTip() in that user data is (largely) subsumed into the message and tip datatypes, but a (user, media) object pair are passed to onMediaPurchase(). To keep life simple, two separate calls to cb.log() are made (ie one per object) in this case.
© Copyright Chaturbate 2011- 2024. All Rights Reserved.