Bots Home
|
Create an App
auspan-debug
Author:
auspan
Description
Source Code
Launch Bot
Current Users
Created by:
Auspan
cb.settings_choices = [ {name: 'cache', label: 'Cache - DO NOT EDIT', type: 'str', defaultValue: '{}'} ] var cache = JSON.parse(cb.settings.cache || '{}'); class Message { constructor(cb_msg) { Object.assign(this, cb_msg); } hide() { this['X-Spam'] = true; } futz() { this.m = "Testing"; } } class Bot { constructor(cbjs) { cbjs.onMessage((msg) => this.processMessage(msg)); } processMessage(msg) { msg = new Message(msg); if(msg.m.charAt(0) == '/') { let command = msg.m.split(/\s+/); switch(command[0].toLowerCase()) { case '/save': cache[command[1]] = command.slice(2).join(' '); cb.log(cache); cb.settings.cache = JSON.stringify(cache); break; } } else { msg.futz(); } return msg; } } if(typeof(cb) !== 'undefined') new Bot(cb);
© Copyright Chaturbate 2011- 2024. All Rights Reserved.