Bots Home
|
Create an App
RickTest
Author:
rickdlhtest
Description
Source Code
Launch Bot
Current Users
Created by:
Rickdlhtest
/*********************************************************************************** * Title: No Grays + Anonymous * By: DeHaan * * Author: "dehaan__" * * Version: 3.5-experimental (2015.06.14) **********************************************************************************/ // EXPERIMENTAL BUILD - uses a "class" + prototype-based scheme var app = function() { this.name = "\"No Grays + Anonymous\""; this.author = "dehaan__"; this.type = "bot"; this.version = "3.5"; this.version_extra = "experimental"; // this.revision = ""; // this.rc_version = ""; this.build_type = "alpha"; this.build_date = "June 11, 2015"; this.color = { green : "#00DD00", // medium green; used to tell if a user can see the show info : "#144D8C", // blue gray; used for neutral notices notice : "#6900CC", // purple; used for chat notices mred : "#dc0000", // moderator red red : "#ff0000", // red; used for important notices syntax : "#995B00" // syntax color; brown-ish }; this.command = { ngastart : "ngastart", // starts the bot ngastop : "ngastop", // stops the bot listall : "listall", // lists all users that can see the show listallowed : "listallowed", // shows the list of manually added users listblocked : "listblocked", // shows the list of manually blocked users adduser : "adduser", // lets a specific user see the cam blockuser : "blockuser", // blocks a specific user from seeing the cam checkuser : "checkuser", // checks if a user can see the cam blockgrays : "blockgrays", // blocks all gray users unblockgrays : "unblockgrays", // unblocks all gray users clearallowed : "clearallowed", // clears the list of allowed users clearblocked : "clearblocked", // clears the list of blocked users ngaabout : "ngaabout", // shows version info ngahelp : "ngahelp", // sends command list to broadcaster ngastatus : "ngastatus" // shows the bot's current status }; this.devcommand = { debugmode : "debugmode", devdump : "devdump" }; this.flag = { debug : false, dev : false, graysBlocked : false, running : false }; this.list = { allowedUsers : [], blockedUsers : [], devs : [], grayUsers : [], tippers : [] }; this.misc = { broadcaster : cb.room_slug, dashLine : "------------------------------------------------------------", developer : this.author, hideMessage : "You must be registered and have tokens to view this show. Register and get some tokens now!", mods : "red", only_bc : "* This command is available only to the broadcaster.", only_dev : "* This command is available only to the developer.", only_mods : "* This command is available only to moderators and the broadcaster.", startMessage : "* Only registered and non-gray viewers can view the show. If you are signed in, and have tokens but cannot see anything, REFRESH your page or type in chat!", startTime : new Date(), stopMessage : "* All users can now view the show!", }; }; app.prototype = { addUser : function(user) { var broadcaster = this.misc.broadcaster; cb.limitCam_addUsers([user]); if (!cbjs.arrayContains(this.list.allowedUsers, user)) { this.list.allowedUsers.push(user); } if (cbjs.arrayContains(this.list.blockedUsers, user)) { cbjs.arrayRemove(this.list.blockedUsers, user); } cb.sendNotice("* \"" + user + "\" can now see the show.", broadcaster, "", this.color.green, "bold"); cb.sendNotice("* Broadcaster \"" + broadcaster +"\" has allowed \"" + user + "\" to see the show.", "", "", this.color.green, "bold", this.misc.mods); cb.sendNotice("* \"" + user + "\", you can now see the show.\n" + "* If you are a gray user, or if you were previously blocked, you can now also chat.", user, "", this.color.green, "bold"); }, blockGrays : function() { var broadcaster = this.misc.broadcaster; if (this.flag.graysBlocked === false) { this.flag.graysBlocked = true; cb.limitCam_removeUsers(this.list.grayUsers); cb.sendNotice("* All gray users have been blocked.", broadcaster, "", this.color.mred, "bold"); cb.sendNotice("* All gray users have been blocked.", "", "", this.color.mred, "bold", this.misc.mods); if (this.debugModeOn()) { cb.log("All gray users have been blocked.") } } else { cb.sendNotice("* Gray users are already blocked!", broadcaster, "", this.color.red, "bold"); } }, blockUser : function(user) { var broadcaster = this.misc.broadcaster; cb.limitCam_removeUsers([user]); if (!cbjs.arrayContains(this.list.blockedUsers, user)) { this.list.blockedUsers.push(user); } if (cbjs.arrayContains(this.list.allowedUsers, user)) { cbjs.arrayRemove(this.list.allowedUsers, user); } cb.sendNotice("* \"" + user + "\" was blocked from the show.", broadcaster, "", this.color.red, "bold"); cb.sendNotice("* Broadcaster \"" + broadcaster +"\" has blocked \"" + user + "\" from seeing the show.", "", "", this.color.red, "bold", this.misc.mods); cb.sendNotice("* The broadcaster has blocked you from seeing this show.", user, "", this.color.red, "bold"); }, checkUser : function(user) { var broadcaster = this.misc.broadcaster; if (cb.limitCam_userHasAccess(user)) { cb.sendNotice("* \"" + user + "\" can view the show.", this.misc.broadcaster, "", this.color.info, "bold"); } else { cb.sendNotice("* \"" + user + "\" cannot view the show.", this.misc.broadcaster, "", this.color.info, "bold"); } }, clearAllowedUsers : function() { if (this.list.allowedUsers.length > 0) { cb.limitCam_removeUsers(this.list.allowedUsers); // remove all users before emptying the array this.list.allowedUsers.length = 0; cb.sendNotice("* The list of allowed users has been cleared.", this.misc.broadcaster, "", this.color.info, "bold"); } else { cb.sendNotice("* The list of allowed users is already empty!", this.misc.broadcaster, "", this.color.info, "bold"); } }, clearBlockedUsers : function() { if (this.list.blockedUsers.length > 0) { // cb.limitCam_addUsers(app.list.blockedUsers); this.list.blockedUsers.length = 0; cb.sendNotice("* The list of blocked users has been cleared.", this.misc.broadcaster, "", this.color.info, "bold"); } else { cb.sendNotice("* The list of blocked users is already empty!", this.misc.broadcaster, "", this.color.info, "bold"); } }, currentStatus : function() { var status = this.misc.dashLine + "\n* Current status is:"; if (cb.limitCam_isRunning()) { status += "\n* Chaturbate's limitCam system is active. "; if (this.flag.graysBlocked === true) { status += "Anonymous & gray users are being blocked."; } else { status += "Only anonymous users are being blocked."; } } else { status += "\n* Chaturbate's limitCam system is NOT active. Anonymous & gray users are not being blocked."; } if (this.isActive()) { status += "\n* The NGA bot is active.\n" + this.misc.dashLine; } else { status += "\n* The NGA bot is NOT active.\n" + this.misc.dashLine; } return status; }, debugModeOn : function() { return this.flag.debug; }, dump : function() { var date = new Date(); var dump_info = this.misc.dashLine + "\n* Dev dump"; dump_info += "\n\n* App info:"; dump_info += "\n* Name: " + this.name + " / Type: " + this.type + " / Version number: " + this.version + " / Build type: " + this.build_type; dump_info += "\n* Time started: " + this.misc.startTime + "\n* Time now: " + date; dump_info += "\n* Flags: (nga.flag.debug: " + this.flag.debug + ") / (nga.flag.dev: " + this.flag.dev + ")" + " / (nga.flag.graysBlocked: " + this.flag.graysBlocked + ") / (nga.flag.running: " + this.flag.running + ")" + "\n" + this.misc.dashLine; return dump_info; }, // flags have been moved to the app() "class" help : function(user) { var command_list = this.misc.dashLine + "\n----- NO GRAYS + ANON'S - COMMANDS LIST -----"; command_list += "\n* --- Commands available to moderators and broadcaster: ---"; command_list += "\n* /ngastop - Stops this bot."; command_list += "\n* /ngastart - Starts this bot."; command_list += "\n* /ngastatus - Shows if the bot is running or not."; command_list += "\n* /ngahelp - Shows this command list."; command_list += "\n* /ngaabout - Shows this bot's version info."; command_list += "\n* --- Commands only available to the broadcaster: ---"; command_list += "\n* /adduser <username> - Manually lets a particular user see your cam."; command_list += "\n* /blockuser <username> - Blocks any user you wish from seeing your cam."; command_list += "\n* /checkuser <username> - Checks if a user can see your cam."; command_list += "\n* /clearallowed - Clears the list of allowed users."; command_list += "\n* /clearblocked - Clears the list of blocked users."; command_list += "\n* /listall - Lists all users who can see your cam."; command_list += "\n* /listallowed - Lists all users who have been manually allowed to see the show."; command_list += "\n* /listblocked - Lists all users who have been blocked from seeing the show."; command_list += "\n* /blockgrays - Blocks all gray users."; command_list += "\n* /unblockgrays - Unblocks all gray users."; command_list += "\n" + "\n* Contact me at @dehaan_cb on Twitter if something doesn't work! Thanks!" + "\n" + this.misc.dashLine; return cb.sendNotice(command_list, user, "", this.color.info, "bold"); }, isActive : function() { return this.flag.running; }, listAll : function() { var allusers = cb.limitCam_allUsersWithAccess(); if (allusers.length > 0) { cb.sendNotice("* " + allusers.length + (allusers.length > 1 ? " users" : " user") + " in show: " + cbjs.arrayJoin(allusers, ", "), this.misc.broadcaster, "", this.color.info, "bold"); } else { cb.sendNotice("* Nobody can view.", this.misc.broadcaster, "", this.color.info, "bold"); } }, listAllowedUsers : function() { var allowed = this.list.allowedUsers; if (allowed.length > 0) { cb.sendNotice("* " + allowed.length + (allowed.length > 1 ? " users" : " user") + " manually allowed to see this show: " + cbjs.arrayJoin(allowed, ", "), this.misc.broadcaster, "", this.color.info, "bold"); } else { cb.sendNotice("* No users manually added.", this.misc.broadcaster, "", this.color.info, "bold"); } }, listBlockedUsers : function() { var blocked = this.list.blockedUsers; if (blocked.length > 0) { cb.sendNotice("* " + blocked.length + (blocked.length > 1 ? " users" : " user") + " manually blocked from seeing this show: " + cbjs.arrayJoin(blocked, ", "), this.misc.broadcaster, "", this.color.info, "bold"); } else { cb.sendNotice("* No users manually blocked.", this.misc.broadcaster, "", this.color.info, "bold"); } }, main : function() { var app_info = this.misc.dashLine + "\n* " + this.name + " by \"" + this.author + "\" has started."; if (this.revision !== undefined) app_info += "\n* Version number: " + this.version + " (" + this.revision + ")"; else if (this.build_type === "rc") app_info += "\n* Version number: " + this.version + "-" + this.version_extra + " (" + this.rc_version + ")"; else if (this.build_type === ("alpha" || "beta" || "staging") || this.version_extra === "preview") app_info += "\n* Version number: " + this.version + "-" + this.version_extra; else app_info += "\n* Version number: " + this.version; app_info += "\n* Build date: " + this.build_date; app_info += "\n* Type /ngahelp for a list of available commands.\n* Type /ngastart to start blocking users or /ngastop to unblock.\n" + this.misc.dashLine; cb.sendNotice(app_info, this.misc.broadcaster, "", this.color.info, "bold"); cb.sendNotice(this.misc.dashLine + "\n* Broadcaster \"" + this.misc.broadcaster + "\" is now running \"" + this.name + "\"." + "\n* Type /ngahelp for a list of available commands.", "", "", this.color.info, "bold", this.misc.mods); if (cb.settings.blockOnStartup === "Yes") { this.start(); cb.sendNotice(this.misc.dashLine + "\n* Anonymous and gray users are now blocked. " + "\n* You can allow them all to see the show via the /ngastop command." + "\n* Or you can allow just gray users to see the show using the /unblockgrays command.\n" + this.misc.dashLine, this.misc.broadcaster, "", this.color.red, "bold"); this.flag.graysBlocked = true; } else { cb.sendNotice(this.misc.dashLine + "\n* NGA was started with the grays & anonymous users blocker DISABLED." + "\n* You must type /ngastart to start blocking these users.\n" + this.misc.dashLine, this.misc.broadcaster, "", this.color.red, "bold"); } if (arguments[0] === "debug") { this.flag.debug = true; cb.sendNotice("* Debugging mode is enabled. Type /debug in chat to see additional debug messages.", this.misc.broadcaster, "", this.color.red, "bold"); cb.log(this.name + " has successfully started."); } if (this.version_extra === "preview") { cb.sendNotice(this.misc.dashLine + "\n* WARNING: This build is only a preview of what the next NGA version will look like.\n" + "* It is mostly unfinished. Most major functions are broken or are not yet implemented. Proceed with care.\n" + this.misc.dashLine, this.misc.broadcaster, "#ffddf4", this.color.mred, "bold"); } else if (this.build_type === "alpha") { cb.sendNotice(this.misc.dashLine + "\n* WARNING: You are currently using an \"alpha\" version of NGA.\n" + "* Some functions may be partially or fully broken, or not fully finished. Proceed with care.\n" + this.misc.dashLine, this.misc.broadcaster, "#ffddf4", this.color.mred, "bold"); } else if (this.build_type === "beta") { cb.sendNotice(this.misc.dashLine + "\n* Note: You are currently using a \"beta\" version of NGA.\n" + "* Some functions may be partially broken. Proceed with care.\n" + this.misc.dashLine, this.misc.broadcaster, "#ffddf4", this.color.mred, "bold"); } else if (this.build_type === "rc") { cb.sendNotice(this.misc.dashLine + "\n* Note: You are currently using a \"Release Candidate\" version of NGA.\n" + "* Some minor bugs may be present and will be fixed in the final release.\n" + this.misc.dashLine, this.misc.broadcaster, "#ffddf4", this.color.mred, "bold"); } }, showVersionInfo : function(user) { var versioninfo = this.misc.dashLine + "\n*** VERSION INFO ***"; versioninfo += "\n* App name: " + this.name; versioninfo += "\n* Author: " + this.author; if (this.revision !== undefined) { versioninfo += "\n* Version: " + this.version + " (" + this.revision + ") - Date: " + this.build_date; } else if (this.build_type === ("alpha" || "beta" || "rc" || "staging") || this.version_extra === "preview") { versioninfo += "\n* Version: " + this.version + "-" + this.version_extra + " - Date: " + this.build_date; } else { versioninfo += "\n* Version: " + this.version + " - Date: " + this.build_date; } versioninfo += "\n* Originally based on jcw2001's \"No Grey Viewers\" and viperlol's \"Block Anonymous Users\".\n" + this.misc.dashLine; return cb.sendNotice(versioninfo, user, "", this.color.info, "bold"); }, start : function() { if (!cb.limitCam_isRunning()) { cb.sendNotice(this.misc.startMessage, "", "", this.color.red, "bold"); try { cb.limitCam_start(cb.settings.hideMessage); } catch (err) { cb.sendNotice("Couldn't start the limitCam system using the message specified on settings.\n" + "Falling back to embedded message.", this.misc.broadcaster, "", this.color.red, "bold"); cb.limitCam_start(this.misc.hideMessage); cb.log(err.message); } if (this.debugModeOn()) { cb.log("The limitCam system has been started."); } this.flag.running = true; } else { cb.sendNotice("* The bot has already been started!", this.misc.broadcaster, "", this.color.red, "bold"); } }, stop : function() { if (cb.limitCam_isRunning()) { cb.sendNotice(this.misc.stopMessage, "", "", this.color.red, "bold"); cb.limitCam_stop(); this.flag.running = false; if (this.debugModeOn()) { cb.log("The limitCam system has been stopped."); } } else { cb.sendNotice("* The bot has already been stopped or isn't active yet!", this.misc.broadcaster, "", this.color.red, "bold"); } }, unblockGrays : function() { var broadcaster = this.misc.broadcaster; if (this.flag.graysBlocked === true) { this.flag.graysBlocked = false; cb.limitCam_addUsers(this.list.grayUsers); cb.sendNotice("* All gray users have been unblocked.", broadcaster, "", this.color.mred, "bold"); cb.sendNotice("* All gray users have been unblocked.", "", "", this.color.mred, "bold", this.misc.mods); if (this.debugModeOn()) { cb.log("All gray users have been unblocked.") } } else { cb.sendNotice("* Gray users are already unblocked!", broadcaster, "", this.color.red, "bold"); } } }; var nga = new app(); cb.settings_choices = [ { name : "blockOnStartup", type : "choice", choice1 : "Yes", choice2 : "No", defaultValue : "Yes", label : "Block users as soon as the bot is started?\n" + "Note: If this option is set to \"No\", then you must type /ngastart\nto start blocking users." }, { name : "hideMessage", type : "str", minLength : 1, maxLength : 384, defaultValue : "You must be registered and have tokens to view this show. Register and get some tokens now!", label : "Registration & tokens required message" } ]; cb.onEnter(function (viewer) { var user = viewer.user; var hasTokens = viewer.has_tokens; var isAnonymous = (user === undefined); var isBroadcaster = (user === nga.misc.broadcaster); var isDev = (user === nga.misc.developer); var isFan = viewer.in_fanclub; var isMod = viewer.is_mod; if (nga.isActive()) { if (hasTokens || isBroadcaster || isDev || isFan || isMod) { cb.limitCam_addUsers([user]); if (nga.list.tippers.indexOf(user) >= 1) { cb.sendNotice("Welcome back, \"" + user + "\"!", user, "", nga.color.notice, "bold"); } } else if (nga.list.tippers.indexOf(user) >= 1) { cb.sendNotice("Welcome back, \"" + user + "\"!", user, "", nga.color.notice, "bold"); cb.limitCam_addUsers([user]); } else if (cbjs.arrayContains(nga.list.allowedUsers, user)) { cb.limitCam_addUsers([user]); } else if (!isAnonymous) { if (!cbjs.arrayContains(nga.list.grayUsers, user)) { nga.list.grayUsers.push(user); } } } }); cb.onLeave(function (viewer) { var user = viewer.user; if (nga.isActive() && nga.list.tippers.indexOf(user) <= 0) { cb.limitCam_removeUsers([user]); } if (!viewer.has_tokens && cbjs.arrayContains(nga.list.blockedUsers, user)) { cbjs.arrayRemove(nga.list.blockedUsers, user) } }); cb.onTip(function (tip) { var user = tip.from_user; if (nga.list.tippers.indexOf(user) <= 0) { nga.list.tippers.push(user); } if (nga.isActive()) { cb.limitCam_addUsers([user]); } }); cb.onMessage(function (msg) { var m = msg.m; var regexCommandSplit = "^" + "/" + "(\\S+)(?:\\b\\s*)(.*)?"; var regexListSplit = /[,\s]+/; var reCmdSplit = new RegExp(regexCommandSplit); var cmdSplit = msg.m.match(reCmdSplit); var cmd; var cmdValue; var cmdSubValue; var cmdValueArray; if (cmdSplit) { cmd = cmdSplit[1]; cmdValue = cmdSplit[2]; if (cmdValue != null) { cmdValue = cmdValue.replace(/^\s+|\s+$/g,''); } if (cmdValue != null) { cmdValueArray = cmdValue.split(regexListSplit); } else { cmdValueArray = ""; } } var user = msg.user; var hasAccess = (cbjs.arrayContains(cb.limitCam_allUsersWithAccess(), user)) var hasTokens = msg.has_tokens; var isBroadcaster = (user === nga.misc.broadcaster); var isDev = (user === nga.author); var isFan = msg.in_fanclub; var isMod = msg.is_mod; if (nga.isActive()) { if (!hasAccess) { if (!(hasTokens || isBroadcaster || isDev || isFan || isMod) && nga.list.tippers.indexOf(user) <= 0) { if (cbjs.arrayContains(nga.list.blockedUsers, user)) { cb.sendNotice("* You were blocked by the broadcaster and you can no longer chat.", user, "", nga.color.mred, "bold"); msg["X-Spam"] = true; } else { cb.sendNotice("* \"" + user + "\", only those with tokens can view the cam. Get some tokens now.", user, "", nga.color.mred, "bold"); if (!cbjs.arrayContains(nga.list.grayUsers, user)) { nga.list.grayUsers.push(user); } msg["X-Spam"] = true; } } else if (cbjs.arrayContains(nga.list.blockedUsers, user)) { cb.sendNotice("You were blocked by the broadcaster and you can no longer chat.", user, "", nga.color.mred, "bold"); msg["X-Spam"] = true; } } else if (!hasTokens) { if (cbjs.arrayContains(nga.list.allowedUsers, user) || nga.flag.graysBlocked === false) { msg["X-Spam"] = false; } else if (cbjs.arrayContains(nga.list.blockedUsers, user)) { cb.sendNotice("* You were blocked by the broadcaster and you can no longer chat.", user, "", nga.color.mred, "bold"); msg["X-Spam"] = true; } } } switch (cmd) { case nga.command.ngastart: if (isBroadcaster || isMod) { nga.start(); } else { cb.sendNotice(nga.misc.only_mods, user, "", nga.color.red, "bold"); } break; case nga.command.ngastop: if (isBroadcaster || isMod) { nga.stop(); } else { cb.sendNotice(nga.misc.only_mods, user, "", nga.color.red, "bold"); } break; case nga.command.ngastatus: if (isBroadcaster || isMod) { cb.sendNotice(nga.currentStatus(), user, "", nga.color.info, "bold"); } else { cb.sendNotice(nga.misc.only_mods, user, "", nga.color.red, "bold"); } break; case nga.command.ngahelp: if (isBroadcaster || isMod) { nga.help(user); } else { cb.sendNotice(nga.misc.only_mods, user, "", nga.color.red, "bold"); } break; case nga.command.ngaabout: if (isBroadcaster || isMod) { nga.showVersionInfo(user); } else { cb.sendNotice(nga.misc.only_mods, user, "", nga.color.red, "bold"); } break; case nga.command.adduser: if (isBroadcaster) { if (cmdValue) { if (cmdValue !== nga.misc.broadcaster) { nga.addUser(cmdValue); } else { cb.sendNotice("* You cannot add yourself!", user, "", nga.color.red, "bold"); } } else { cb.sendNotice("* Syntax: /adduser <username>", user, "", nga.color.syntax, "bold"); } } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.blockuser: if (isBroadcaster) { if (cmdValue) { if (cmdValue !== nga.misc.broadcaster) { nga.blockUser(cmdValue); } else { cb.sendNotice("* You cannot block yourself!", user, "", nga.color.red, "bold"); } } else { cb.sendNotice("* Syntax: /blockuser <username>", user, "", nga.color.syntax, "bold"); } } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.checkuser: if (isBroadcaster) { if (cmdValue) { nga.checkUser(cmdValue); } else { cb.sendNotice("* Syntax: /checkuser <username>", user, "", nga.color.syntax, "bold"); } } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.listall: if (isBroadcaster) { nga.listAll(); } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.listallowed: if (isBroadcaster) { nga.listAllowedUsers(); } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.listblocked: if (isBroadcaster) { nga.listBlockedUsers(); } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.clearallowed: if (isBroadcaster) { nga.clearAllowedUsers(); } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.clearblocked: if (isBroadcaster) { nga.clearBlockedUsers(); } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.blockgrays: if (isBroadcaster) { nga.blockGrays(); } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.command.unblockgrays: if (isBroadcaster) { nga.unblockGrays(); } else { cb.sendNotice(nga.misc.only_bc, user, "", nga.color.red, "bold"); } break; case nga.devcommand.debugmode: if (isDev) { if (cmdValue) { if (cmdValue === "on") { if (nga.flag.debug === false) { nga.flag.debug = true; cb.sendNotice("* Debug mode has been enabled.", user, "", nga.color.info, "bold"); } else { cb.sendNotice("* Debug mode is already enabled!", user, "", nga.color.info, "bold"); } } else if (cmdValue === "off") { if (nga.flag.debug === true) { nga.flag.debug = false; cb.sendNotice("* Debug mode has been disabled.", user, "", nga.color.info, "bold"); } else { cb.sendNotice("* Debug mode is already disabled!", user, "", nga.color.info, "bold"); } } else { cb.sendNotice("* Invalid argument.", user, "", nga.color.info, "bold"); } } else { cb.sendNotice("* Syntax: /debugmode <on / off>", user, "", nga.color.syntax, "bold"); } } else { cb.sendNotice(nga.misc.only_dev, user, "", nga.color.red, "bold"); } break; case nga.devcommand.devdump: if (isDev) { if (cmdValue === "dev") { if (!cbjs.arrayContains(nga.list.devs, user)) { nga.list.devs.push(user); nga.flag.dev = true; } else { cbjs.arrayRemove(nga.list.devs, user); nga.flag.dev = false; } } else { cb.sendNotice(nga.dump(), user, "", nga.color.info, "bold"); } } else { cb.sendNotice(nga.misc.only_dev, user, "", nga.color.red, "bold"); } break; } // end switch (cmd) if (/^(\?|!)/.test(m)) { msg["X-Spam"] = true; return cb.sendNotice("* " + nga.name + ": Incorrect command prefix.", user, "", nga.color.mred, "bold"); } if (cbjs.arrayContains(nga.list.devs, user)) { if (isDev) { msg.c = "#00704e"; } } if (m[0] === "/") { msg["X-Spam"] = true; } if (!hasAccess && !cbjs.arrayContains(nga.list.blockedUsers, user)) { if (hasTokens || isBroadcaster || isDev || isFan || isMod) { cb.limitCam_addUsers([user]); } else { if (!cbjs.arrayContains(nga.list.grayUsers, user)) { nga.list.grayUsers.push(user); } } } return msg; }); try { if (nga.build_type === ("alpha" || "beta" || "rc" || "staging") || nga.version_extra === "preview") { nga.main("debug"); } else { nga.main(); } } catch (err) { cb.sendNotice("* An error has occurred.\n" + err.message, nga.misc.broadcaster, "", nga.color.red, "bold"); cb.log(err.message); }
© Copyright Chaturbate 2011- 2024. All Rights Reserved.