Bots Home
|
Create an App
test1
Author:
justsomeguy_
Description
Source Code
Launch Bot
Current Users
Created by:
Justsomeguy_
// // // // // // // "use strict"; /* global cb */ Boolean.parseBoolean = function parseBoolean (arg) { if (arg !== undefined) { switch (arg) { case 0: case "0": case "false": return false; case 1: case "1": case "true": return true; default: throw new Error("Cannot parse boolean for this argument."); } } else { return; } }; Number.prototype.getOrdinal = function() { switch (this % 100) { case 11: case 12: case 13: return this + "th"; } switch (this % 10) { case 1: return this + "st"; case 2: return this + "nd"; case 3: return this + "rd"; default: return this + "th"; } }; Number.prototype.separate = function() { var str = this.toString().split("."); if (str[0].length >= 5) { str[0] = str[0].replace(/(\d)(?=(\d{3})+$)/g, "$1,"); } if (str[1] && str[1].length >= 5) { str[1] = str[1].replace(/(\d{3})/g, "$1 "); } return str.join("."); }; cb.onMessage(function(msg) { const CMD_REGEXP = /^!|\//g; var MsgSender = { gender: msg.gender, isDarkBlue: msg.tipped_recently, isDarkPurple: msg.tipped_tons_recently, isFcMember: msg.in_fanclub, isGray: !(msg.has_tokens), isLightPurple: msg.tipped_alot_recently, isMod: msg.is_mod, name: msg.user }; var MsgText = msg.m; msg.bg = msg.background; msg.fg = msg.c; msg.font = msg.f; msg.isCommand = CMD_REGEXP.test(MsgText); msg.isHidden = msg["X-SPAM"]; if (msg.isHidden === undefined) msg.isHidden = false; msg.toggleHidden = function toggleHidden (arg) { if (Boolean.parseBoolean(arg) === true) { msg.isHidden = true; } else { msg.isHidden = false; } }; if (msg.isCommand) { msg.toggleHidden("true"); } cb.sendNotice( "Message text: " + MsgText + "\nIs command: " + msg.isCommand + "\nIs hidden: " + msg.isHidden + "\nSent by: " + MsgSender.name); return msg; });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.