Apps Home
|
Create an App
allTimeTips
Author:
mexolius
Description
Source Code
Launch App
Current Users
Created by:
Mexolius
var todaysTips= new Map(); cb.settings_choices=[ {name: 'initJSON', type:'str', required: false} ]; function init(){ if(cb.settings.initJSON!==undefined) { var startVals=JSON.parse(cb.settings.initJSON); cb.chatNotice(startVals[1]); } } cb.onTip(tip=>{ var prevtips= todaysTips.get(tip.from_user); var toAdd=(prevtips===undefined?0:parseInt(prevtips)); todaysTips.set(tip.from_user,toAdd+parseInt(tip.amount)); }); cb.onMessage(msg=>{ if(msg.m=='/haul') if(msg.user==cb.room_slug) cb.chatNotice("Todays haul:\n"+JSON.stringify(todaysTips.entries())); msg['X-Spam']=true; return msg; }); init()
© Copyright Chaturbate 2011- 2024. All Rights Reserved.