Bots Home
|
My Uploads
|
Create an App
canitestabot
Author:
canigetatest
Description
Source Code
Launch Bot
Current Users
Created by:
Canigetatest
App Images
!function(e){var s={};function t(i){if(s[i])return s[i].exports;var n=s[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}t.m=e,t.c=s,t.d=function(e,s,i){t.o(e,s)||Object.defineProperty(e,s,{enumerable:!0,get:i})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,s){if(1&s&&(e=t(e)),8&s)return e;if(4&s&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&s&&"string"!=typeof e)for(var n in e)t.d(i,n,function(s){return e[s]}.bind(null,n));return i},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,s){return Object.prototype.hasOwnProperty.call(e,s)},t.p="",t(t.s=19)}([function(e,s,t){s.app=t(7),s.bot=t(2),s.constants=t(1),s.message=t(4),s.user=t(3),s.pluginAbstract=t(6),s.pluginHelp=t(5)},function(e,s){e.exports={chars:{hearts:":heart2",hearts2:":Hearts2",glitter:":pixelglitter",flowers:":tinyflower2",bow:":bluebow",smiley:":smile",text_queen:String.fromCodePoint(9813),text_queen_full:String.fromCodePoint(9819),text_heart:String.fromCodePoint(9829),text_diamond:String.fromCodePoint(9830),text_star:String.fromCodePoint(9733),text_star_pointed:String.fromCodePoint(10022),text_right:String.fromCodePoint(9658),text_left:String.fromCodePoint(9664),text_right_small:String.fromCodePoint(9656),text_left_small:String.fromCodePoint(9666),text_stopwatch:String.fromCodePoint(9200),text_clock:String.fromCodePoint(9201),text_hourglass:String.fromCodePoint(8987),text_hourglass_flowing:String.fromCodePoint(9203),text_dotted_line:String.fromCodePoint(10649)},colors:{black:"#000",white:"#fff",cream:"#f9f6ed",fan_green:"#e6f9e6",mod_red:"#ffe7e7",help:"#06140d",help_bg:"#f2ffe6",tipnote_yellow:"#ffff00",legend_purple:"#e8f4f8",legend_green:"#f3ecf9",timer_blue:"#add8e6",timer_magenta:"#ffa6ff",light_grey:"#e6e6e6",grey:"#aaa",dark_grey:"#333",light_aqua:"#adeaea",dark_aqua:"#006767",light_red:"#ff9a9a",red:"#f4c1bc",dark_red:"#cc0000",light_orange:"#ffd9b3",orange:"#F65F00",dark_orange:"#e77400",light_yellow:"#ffff94",yellow:"#f4d599",dark_yellow:"#E6D200",light_green:"#94e594",green:"#00B300",dark_green:"#006600",light_blue:"#d1eaee",blue:"#0099ff",dark_blue:"#0629AC",light_purple:"#f2cdff",purple:"#e2a2ea",dark_purple:"#3d003d",light_pink:"#FFE6EA",pink:"#FF00EE",dark_pink:"#FF6680"}}},function(e,s,t){"use strict";let i=t(8),n=t(10),a=t(15),o=t(5);e.exports=class{constructor(e){this.api=e,this.methods=["onEnter","onMessage","onTip","onLeave"],this.commands=new n(this.api),this.settings=new a(this.api),this.plugins=[],this.help=new o,this.register(this.help),this.callPlugins=function(e,s){let t,i;for(t in this.plugins)i=this.plugins[t],"function"==typeof i[e]&&i[e].apply(i,s)}}run(){this.help.discover(this.plugins),this.api.settings_choices=this.settings.fetch(),new i(this.api).initialise(this.methods,this)}register(e){return"function"==typeof e.setDependencies&&e.setDependencies(this.api),this.commands.register(e),this.settings.register(e),this.plugins.push(e),this}onStart(e){this.callPlugins.call(this,"onStart",[e])}onEnter(e){this.callPlugins.call(this,"onEnter",[e])}onMessage(e,s){return s.isCommand()?(s.hide(),this.commands.handle(e,s)):this.callPlugins.call(this,"onMessage",[e,s]),s.getResponse()}onTip(e,s,t,i){this.callPlugins.call(this,"onTip",[e,s,t,i])}onLeave(e){this.callPlugins.call(this,"onLeave",[e])}}},function(e,s,t){"use strict";class i{constructor(e,s,t,i,n,a,o){this.name=e,this.gender=s,this.isHost=!!t,this.isMod=!!i,this.isFan=!!n,this.isAnon=!!a,this.tippedRecently=!!o,this.isSilenced=!1}static createFromMessage(e,s){return new i(e.user,e.gender,e.user===s,e.is_mod,e.in_fanclub,!1,e.tipped_recently)}static createFromTip(e,s){return new i(e.from_user,e.from_user_gender,!1,e.from_user_is_mod,e.from_user_in_fanclub,e.is_anon_tip,e.from_user_tipped_recently)}static createFromUsername(e,s){return new i(e,!1,!1,e===s,!1,!1,!1)}silence(){this.isSilenced=!0}unsilence(){this.isSilenced=!1}hasPermission(e){return void 0===e||e.constructor===Array&&e.indexOf(this.getRole())>-1}getRole(){switch(!0){case this.isHost:return"host";case this.isMod:return"mod";case this.isFan:return"fan";default:return}}addRole(e){switch(e){case"mod":this.isMod=!0;break;case"fan":this.isFan=!0}return this}removeRole(e){switch(e){case"mod":this.isMod=!1;break;case"fan":this.isFan=!1}return this}}e.exports=i},function(e,s,t){"use strict";let i=function(e){-1==e.indexOf(" ")&&(e+=" ");let s=e.split(" ");return[s[0].substring(1).trim(),s.slice(1).join(" ").trim()]};class n{constructor(e,s,t){this.message=e.trim(),this.user=s,this.response=t,this.command=null,this.parsed=null}static create(e,s){return new n("","",s)}static createFromTip(e,s){return new n(e.message,s)}isEmpty(){return""===this.message}isCommand(){return"/"===this.message.charAt(0)}getCommand(){return this.isCommand()&&null===this.command&&(this.command=i(this.message)[0]),this.command}getCommandParameters(e){if(null===this.parsed){let e=i(this.message)[1];this.parsed=e}return this.parsed}isHidden(){return!0===this.response["X-Spam"]}hide(){return this.response["X-Spam"]=!0,this}show(){return this.response.hasOwnProperty("X-Spam")&&delete this.response["X-Spam"],this}setMessage(e){this.message=e,this.response.m=e}setBackground(e){this.response.background=e}getUser(){return this.user}getResponse(){return this.response}}e.exports=n},function(e,s,t){"use strict";var i=t(6),n=t(1);e.exports=class extends i{constructor(){super(),this.name="Help",this.commands={help:{scope:this,handler:this.displayHelp}},this.descriptions=[]}discover(e){for(let s in e)e[s].commands&&this.iterateCommands(e[s].commands)}iterateCommands(e){var s;for(s in e)e.hasOwnProperty(s)&&this.appendHelpMessage(s,e[s])}appendHelpMessage(e,s){s.description&&this.descriptions.push({message:`/${e}: ${s.description}`,access:s.access})}displayHelp(e,s){var t,i,a=[];for(t in this.descriptions)i=this.descriptions[t],e.hasPermission(i.access)&&a.push(i.message);a.length<1||this.api.sendNotice(a.join("\n"),e.name,n.colors.help_bg,n.colors.help,"bold")}}},function(e,s,t){"use strict";e.exports=class{constructor(){this.api=null,this.name="",this.settings=[],this.commands={}}setDependencies(e){this.api=e}getStatus(){return this.name+" - Available commands:"}}},function(e,s,t){"use strict";let i=t(2);e.exports=class extends i{constructor(e){super(e),this.methods.push("onDrawPanel")}onDrawPanel(e,s){return this.callPlugins.call(this,"onDrawPanel",[e,s]),s.getResponse()}}},function(e,s,t){"use strict";let i=t(3),n=t(9),a=t(4);e.exports=class{constructor(e){this.api=e,this.intercepts={}}initialise(e,s){for(let t in e){let i=e[t],n=s[i];"function"==typeof n&&this.api[i](this.proxy(i,s,n))}let t=i.createFromUsername(this.api.room_slug,this.api.room_slug);s.onStart(t)}proxy(e,s,t){return this[e]?function(){let i=this[e].apply(this,arguments);return"function"==typeof this.intercepts[e]&&(t=this.intercepts[e].apply(s,[t].concat(i))),t.apply(s,i)}.bind(this):function(){return this.api.log("Proxied "+e),t.apply(s,arguments)}}onEnter(e){return[i.createFromMessage(e,this.api.room_slug)]}onMessage(e){let s=i.createFromMessage(e,this.api.room_slug);return[s,new a(e.m,s,e)]}onTip(e){let s=i.createFromTip(e,this.api.room_slug),t=i.createFromUsername(e.to_user,this.api.room_slug),n=a.createFromTip(e,s);return[s,t,Number.parseInt(e.amount,10),n]}onLeave(e){return[i.createFromMessage(e,this.api.room_slug)]}onDrawPanel(e){let s=i.createFromMessage(e,this.api.room_slug);return[s,new n(s)]}}},function(e,s,t){"use strict";e.exports=class{constructor(e){this.user=e,this.templates=["3_rows_of_labels","3_rows_11_21_31","3_rows_12_21_31","3_rows_12_22_31","image_template"],this.response={template:this.templates[0],row1_label:"",row1_value:"",row2_label:"",row2_value:"",row3_label:"",row3_value:""}}setPanel(e){this.response=e}getResponse(){return this.response}}},function(e,s,t){"use strict";let i=t(1),n=t(11),a=t(12),o=t(13);e.exports=class{constructor(e){this.api=e,this.commands={},this.subcommands={}}register(e){if(!e.commands)return this;for(let s in e.commands){if(this.commands.hasOwnProperty(s))throw new n("Specified command '"+s+"' conflicts with an existing command.");if(e.commands[s].scope||(e.commands[s].scope=e),this.commands[s]=e.commands[s],this.subcommands[s]={command_names:[],handlers:{},help:[]},e.commands[s].hasOwnProperty("subcommands"))for(let t of e.commands[s].subcommands){this.subcommands[s].help.push(`${t.names.join("|")} : ${t.description}`);for(let e of t.names)this.subcommands[s].command_names.push(e),Object.assign(this.subcommands[s].handlers,{[e]:{handler:t.handler,success:t.success}})}}return this}handle(e,s){try{let t=s.getCommand(),n=t;if(!this.commands[t])return s.getResponse();if(t=this.commands[t],t.access&&!e.hasPermission(t.access))throw new o("You do not have permission to use that command");let r=[];t.params&&(r=s.getCommandParameters(t.params));let l=!0;if(t.hasOwnProperty("subcommands")){r=r.split(" ");let s=r.shift();""===s?this.api.sendNotice(("function"==typeof t.scope.getStatus?t.scope.getStatus()+"\n":"")+this.subcommands[n].help.join("\n"),e.name,i.colors.help_bg,i.colors.help,"bold"):this.subcommands[n].command_names.includes(s)&&"function"==typeof this.subcommands[n].handlers[s].handler?(l=this.subcommands[n].handlers[s].handler.apply(t.scope,[e,r]),void 0!==l&&!0!==l||this.api.sendNotice(this.subcommands[n].handlers[s].success,e.name,i.colors.light_green,i.colors.dark_green,"bold")):this.api.sendNotice("Command not implemented...",e.name,i.colors.light_yellow)}else l=t.handler.apply(t.scope,[e].concat(r));if(void 0!==l&&!0!==l)throw new a("Failed: "+l)}catch(s){this.api.sendNotice(s.toString(),e.name,i.colors.light_red,i.colors.black,"bold")}finally{return s.getResponse()}}}},function(e,s,t){"use strict";class i extends Error{}e.exports=i},function(e,s,t){"use strict";class i extends Error{}e.exports=i},function(e,s,t){"use strict";var i=t(14);e.exports=class extends i{}},function(e,s,t){"use strict";class i extends Error{}e.exports=i},function(e,s,t){"use strict";e.exports=class{constructor(e){this.api=e,this.settings=[]}register(e){let s=e.settings;if(!s||s.constructor!==Array||0===s.length)return this;this.settings.push({name:"settings_"+e.name.replace(/\s+/g,"")+"_header",type:"choice",required:!1,label:":".repeat(20)+" "+e.name.toUpperCase()+" "+":".repeat(20)});for(let e=0;e<s.length;e++)this.settings.push(s[e]);return this}fetch(){return this.settings}}},,,,function(e,s,t){let i=t(0).bot,n=t(20),a=t(21),o=t(22),r=t(23),l=t(24),d=t(25),h=new i(cb);h.register(new o),h.register(new l),h.register(new r),h.register(new a),h.register(new n),h.register(new d),h.run()},function(e,s,t){let i=t(0).constants,n=t(0).pluginAbstract;e.exports=class extends n{constructor(){super(),this.name="Blocker",this.settings=[{type:"choice",name:"blocker_enable",label:"Enable or disable blocking",choice1:"Enable",choice2:"Disable",defaultValue:"Enable"},{type:"str",name:"blocker_words",label:"Blocked words (lowercase)",defaultValue:"cunt,bitch,slut,c2c,cumslut,whore"}],this.commands={block:{access:["host","mod"],handler:this.block,description:"Do blocking stuff",params:/(.+)/,subcommands:[{names:["start","on"],description:'Enable word blocking with "/block start" or "/block on"',handler:this.enable,success:"Word blocking started."},{names:["stop","off"],description:'Disable word blocking with "/block stop" or "/block off"',handler:this.disable,success:"Word blocking stopped."},{names:["reset"],description:'Reset blocked words to default settings with "/block reset"',handler:this.initBlocker,success:"Blocked words reset to default settings."},{names:["list","show"],description:'List blocked words with "/block list"',handler:this.showWords,success:"Blocked words listed."},{names:["add","new"],description:'Add a blocked word with "/block add badword"',handler:this.addWord,success:"Blocked word added."},{names:["edit","change"],description:'Edit a blocked word with "/block edit 3 newbadword"',handler:this.editWord,success:"Blocked word updated."},{names:["remove","rm","del"],description:'Remove blocked word with "/block remove 3"',handler:this.removeWord,success:"Blocked word removed."}]}},this.mods=[],this.words=[],this.enabled=!0}enable(){this.enabled=!0}disable(){this.enabled=!1}initBlocker(){if(!this.api.settings.blocker_words)return;let e=[];for(let s of this.api.settings.blocker_words.split(","))e.push(s.trim());this.words=e}showWords(e){let s=[];for(let e=0;e<this.words.length;e++)s.push("#"+(e+1)+" - "+this.words[e]);this.api.sendNotice(s.join("\n"),e.name,i.colors.white,i.colors.dark_red,"bold")}addWord(e,s){let t=s.join(" ").trim();if(this.words.includes(t))return"This word already exists.";this.words.push(t)}editWord(e,s){let t=Number.parseInt(s.shift(),10),i=s.join(" ");if(t>this.words.length)return`Word #${t} does not exist.`;this.words[t-1]=i}removeWord(e,s){let t=Number.parseInt(s,10);if(t>this.words.length)return`Word #${t} does not exist.`;this.words.splice(t-1,1)}onStart(){this.initBlocker(),"Enable"!==this.api.settings.blocker_enable&&(this.enabled=!1)}onEnter(e){e.isMod&&!this.mods.includes(e.name)&&(this.mods.push(e.name),this.api.sendNotice("You've been added to the word blocker mods list. Shh.",e.name,i.colors.light_orange,i.colors.dark_red,"bold"))}onMessage(e,s){if(this.enabled&&!e.hasPermission(["host","mod","fan"]))for(let t of this.words)if(!(s.message.length<t.length)&&s.message.toLowerCase().includes(t)){s.hide();let t=`Blocked message from ${e.name}: ${s.message}`;if(this.api.sendNotice(t,this.api.room_slug,i.colors.light_orange,i.colors.dark_red,"bold"),this.mods.length>0)for(let e of this.mods)this.api.sendNotice(t,e,i.colors.light_orange,i.colors.dark_red,"bold");break}}getStatus(){return`${this.name}: ${this.enabled?"[ running ]":"[ stopped ]"} - Available commands:`}}},function(e,s,t){let i=t(0).constants,n=t(0).pluginAbstract;e.exports=class extends n{constructor(){super(),this.name="Cleaner",this.commands={clean:{access:["host","mod"],handler:this.clean,description:"Clean up the chat with lines of dots...",params:/(\d+)/}}}clean(e,s){let t;s&&Number.parseInt(s,10)||(s=20);let n=[];for(t=1;t<=s;t++)n.push(".".repeat(t));this.api.sendNotice(n.join("\n")+"\nMoving on.","",i.colors.light_blue)}}},function(e,s,t){let i=t(0).constants,n=t(0).pluginAbstract;e.exports=class extends n{constructor(){super(),this.name="Notices",this.total=10,this.settings=[{type:"choice",name:"notices_enable",label:"Enable or disable notices",choice1:"Enable",choice2:"Disable",defaultValue:"Enable"},{type:"int",name:"notices_interval",label:"Display interval (in minutes, 0 to disable)",minValue:0,maxValue:120,defaultValue:4},{type:"str",name:"notices_color",label:"Notices text color (hex)",defaultValue:i.colors.dark_grey},{type:"str",name:"notices_bg",label:"Notices background color (hex)",defaultValue:i.colors.white}];for(let e=0;e<this.total;e++){let s={type:"str",name:"notice_"+(e+1),label:"Notice #"+(e+1),required:!1,defaultValue:""};this.settings.push(s)}this.commands={notices:{access:["host","mod"],handler:this.notices,description:"Do notices stuff",params:/(.+)/,subcommands:[{names:["start","on"],description:'Enable notices with "/notices start" or "/notices on"',handler:this.enable,success:"Notices started."},{names:["stop","off"],description:'Disable notices with "/notices stop" or "/notices off"',handler:this.disable,success:"Notices stopped."},{names:["reset"],description:'Reset notices to default settings with "/notices reset"',handler:this.initNotices,success:"Notices reset to defaults."},{names:["list","show"],description:'List notices with "/notices list", or "/notices list all" to display all notices publicly',handler:this.showNotices,success:"Notices listed."},{names:["add","new"],description:'Add a notice with "/notices add A new notice"',handler:this.addNotice,success:"Notice added."},{names:["edit","change"],description:'Edit a notice with "/notices edit 3 Edited notice"',handler:this.editNotice,success:"Notice updated."},{names:["remove","rm","del"],description:'Remove a notice with "/notices remove 3"',handler:this.removeNotice,success:"Notice removed."},{names:["interval"],description:'Set notice interval (in minutes, 0 to disable) with "/notices interval 3"',handler:this.setInterval,success:"Notice interval updated."}]}},this.commands.notice={access:["host","mod"],handler:this.notices,description:"Alias for /notices",params:/(.+)/,subcommands:this.commands.notices.subcommands},this.items=[],this.next=0,this.enabled=!0,this.interval=12e4}enable(){this.enabled=!0}disable(){this.enabled=!1}setInterval(e,s){this.interval=6e4*Number.parseInt(s.join(""),10)}showInterval(){this.enabled&&0!==this.interval&&(this.showNotice(),this.api.setTimeout(function(){this.showInterval()}.bind(this),this.interval))}initNotices(){let e=[];for(let s=0;s<this.total;s++){let t=this.api.settings["notice_"+(s+1)];t&&e.push(t.trim())}this.items=e}showNotice(){if(!this.items)return;let e=this.items[this.next];this.next=this.next<this.items.length-1?this.next+1:0,this.api.sendNotice(e,"",this.api.settings.notices_bg,this.api.settings.notices_color,"bold")}showNotices(e,s){let t=e?e.name:"";e&&e.hasPermission(["host","mod"])&&s&&"all"===s.join("").trim()&&(t="");let i=[];for(let e=0;e<this.items.length;e++)i.push("#"+(e+1)+" - "+this.items[e]);this.api.sendNotice(i.join("\n"),t,this.api.settings.notices_bg,this.api.settings.notices_color,"bold")}addNotice(e,s){let t=s.join(" ").trim();if(this.items.includes(t))return"This notice already exists.";this.items.push(t)}editNotice(e,s){let t=Number.parseInt(s.shift(),10);if(t>this.items.length)return`Notice #${t} does not exist.`;let i=s.join(" ");this.items[t-1]=i}removeNotice(e,s){let t=Number.parseInt(s,10);if(t>this.items.length)return`Notice #${t} does not exist.`;this.items.splice(t-1,1)}onStart(){this.initNotices(),"Enable"!==this.api.settings.notices_enable&&(this.enabled=!1),this.interval=6e4*Number.parseInt(this.api.settings.notices_interval,10),this.interval>0&&this.showInterval(),this.api.log("Notices started.")}getStatus(){return`${this.name}: ${this.enabled?"[ running ]":"[ stopped ]"} Notice every ${this.interval/6e4} minute${this.interval>1?"s":""} - Available commands:`}}},function(e,s,t){let i=t(0).constants,n=t(0).pluginAbstract;e.exports=class extends n{constructor(){super(),this.name="Legends",this.settings=[{type:"choice",name:"legends_enable",label:"Enable or disable legends",choice1:"Enable",choice2:"Disable",defaultValue:"Enable"},{type:"str",name:"legends_header",label:"Legends board header",defaultValue:"Legends"},{type:"str",name:"legends_madlads",label:"Madlads (comma separated)",defaultValue:""},{type:"int",name:"legends_interval",label:"Legends board interval (in minutes, 0 to disable)",minValue:0,maxValue:120,defaultValue:3},{type:"choice",name:"king_enable",label:"Enable or disable crowning a king",choice1:"Enable",choice2:"Disable",defaultValue:"Enable"},{type:"str",name:"legends_board_color",label:"Legends board text color (hex)",defaultValue:i.colors.dark_blue},{type:"str",name:"legends_board_bg",label:"Legends board background color (hex)",defaultValue:i.colors.light_purple},{type:"str",name:"legends_new_color",label:"New legend text color (hex)",defaultValue:i.colors.dark_blue},{type:"str",name:"legends_new_bg",label:"New legend background color (hex)",defaultValue:i.colors.light_blue},{type:"str",name:"legends_madlad_color",label:"New madlad text color (hex)",defaultValue:i.colors.dark_purple},{type:"str",name:"legends_madlad_bg",label:"New madlad background color (hex)",defaultValue:i.colors.light_purple},{type:"str",name:"legends_king_color",label:"New king text color (hex)",defaultValue:i.colors.dark_purple},{type:"str",name:"legends_king_bg",label:"New king background color (hex)",defaultValue:i.colors.cream}],this.commands={legends:{access:["host","mod"],handler:this.legends,description:"Do legendary stuff",params:/(.+)/,subcommands:[{names:["start","on"],description:'Enable legends with "/legends start" or "/legends on"',handler:this.enable,success:"Legends started."},{names:["stop","off"],description:'Disable legends with "/legends stop" or "/legends off"',handler:this.disable,success:"Legends stopped."},{names:["list","show"],description:'List legends with "/legends list", or "/legends list all" to display the legends board',handler:this.showLegends,success:"Legends listed."},{names:["add","new"],description:'Add a legend with "/legends add legendname"',handler:this.addLegend,success:"Legend added."},{names:["madlad","madd"],description:'Add a madlad with "/legends madlad madladname"',handler:this.addMadlad,success:"Madlad added."},{names:["remove","rm","del"],description:'Remove a legend or madlad with "/legends remove username"',handler:this.removeMadlad,success:"Madlad removed."},{names:["ticket"],description:'Add legends to ticket show with "/legends ticket"',handler:this.addLegends,success:"Legends added to ticket show."},{names:["interval"],description:'Set legends board interval (in minutes, 0 to disable) with "/legends interval 3"',handler:this.setInterval,success:"Legends board interval updated."}]}},this.commands.legend={access:["host","mod"],handler:this.legends,description:"Alias for /legends",params:/(.+)/,subcommands:this.commands.legends.subcommands},this.totals={},this.king="",this.king_amount=500,this.enabled=!0,this.interval=18e4,this.legends=[],this.madlads=[],this.separator="|",this.legends_minimum=1e3,this.legends_madlads=1e4,this.header_icon=i.chars.text_queen,this.madlads_icon=i.chars.text_star}enable(){this.enabled=!0}disable(){this.enabled=!1}setInterval(e,s){this.interval=6e4*Number.parseInt(s.join(""),10)}showInterval(){this.enabled&&0!==this.interval&&(this.showLegends(),this.api.setTimeout(function(){this.showInterval()}.bind(this),this.interval))}showLegends(e,s){let t=e?e.name:"",i=[],n=[],a=this.api.settings.legends_header;n.push(this.header_icon+" "+a+" "+this.header_icon),n.push("-".repeat(a.length+9));for(let e of this.madlads)n.push(this.madlads_icon+" "+e+" "+this.madlads_icon);for(let e of this.legends)i.push(e);for(let e of Object.keys(this.totals)){let s=e;this.madlads.includes(e)||this.legends.includes(e)||(this.totals[e]>=this.legends_madlads&&(s=this.madlads_icon+" "+s+" "+this.madlads_icon),this.totals[e]>=this.legends_minimum&&i.push(s))}i.sort((e,s)=>this.totals[e]-this.totals[s]).reverse(),i=n.concat(i),i.push("-".repeat(a.length+9)),this.api.sendNotice(i.join("\n"),s&&"all"===s.join("")?"":t,this.api.settings.legends_board_bg,this.api.settings.legends_board_color,"bold")}addLegend(e,s){let t=s.join("").trim();if(this.legends.includes(t))return"Legend already added.";this.legends.push(t)}addMadlad(e,s){let t=s.join("").trim();if(this.madlads.includes(t))return"Madlad already added.";this.madlads.push(t)}removeMadlad(e,s){let t=s.join("").trim(),i=this.madlads.indexOf(t);if(i<0)return t+" does not exist.";this.madlads.splice(i,1)}addLegends(){let e=[];for(let s of Object.keys(this.totals))this.totals[s]>=this.legends_minimum&&!this.api.limitCam_userHasAccess(s)&&(e.push(s),this.api.sendNotice(`Welcome to the ticket show, legendary ${s}! (sent privately)`,s,this.api.settings.legends_new_bg,this.api.settings.legends_new_color,"bold"));this.api.limitCam_addUsers(e)}onStart(){if("Enable"!==this.api.settings.legends_enable&&(this.enabled=!1),this.api.settings.legends_madlads){let e=this.api.settings.legends_madlads.trim();if(""!==e)for(let s of e.split(","))this.madlads.includes(s)||this.madlads.push(s.trim())}["annahaven","canigetatest"].includes(this.api.room_slug)&&(this.separator=" "+i.chars.text_dotted_line+" ",this.header_icon=i.chars.text_queen_full,this.madlads_icon=i.chars.text_star_pointed),this.interval=6e4*Number.parseInt(this.api.settings.legends_interval,10),this.interval>0&&this.showInterval(),this.api.log("Legends started.")}onTip(e,s,t,i){if(e.isAnon)return;let n=0;this.totals.hasOwnProperty(e.name)?(n=this.totals[e.name],this.totals[e.name]+=t):Object.assign(this.totals,{[e.name]:t}),this.enabled&&this.totals[e.name]>=this.legends_minimum&&n<this.legends_minimum?this.api.sendNotice(`Thank you ${e.name} for becoming a legend!`,"",this.api.settings.legends_new_bg,this.api.settings.legends_new_color,"bold"):this.enabled&&this.totals[e.name]>=this.legends_madlads&&n<this.legends_madlads&&this.api.sendNotice(`Thank you ${e.name} for becoming a madlad!`,"",this.api.settings.legends_madlad_bg,this.api.settings.legends_madlad_color,"bold"),"Enable"===this.api.settings.king_enable&&this.totals[e.name]>this.king_amount&&(this.king_amount=this.totals[e.name],e.name!==this.king&&(this.king=e.name,this.api.sendNotice(String.raw`:crowngold Congratulations ${e.name} on becoming the new king for the show!`,"",this.api.settings.legends_king_bg,this.api.settings.legends_king_color,"bold")))}onMessage(e,s){this.totals.hasOwnProperty(e.name)||Object.assign(this.totals,{[e.name]:0});let t=this.totals[e.name];t>0&&s.setMessage(this.separator+t+this.separator+" "+s.message),this.enabled&&("Enable"===this.api.settings.king_enable&&e.name===this.king?s.setMessage(":crowngold "+s.message):t>=this.legends_madlads||this.madlads.includes(e.name)?s.setMessage(i.chars.text_queen_full+" "+s.message):t>=this.legends_minimum&&s.setMessage(i.chars.text_queen+" "+s.message))}getStatus(){return`${this.name}: ${this.enabled?"[ running ]":"[ stopped ]"} Notice every ${this.interval/6e4} minute${this.interval>1?"s":""} - Available commands:`}}},function(e,s,t){let i=t(0).constants,n=t(0).pluginAbstract;e.exports=class extends n{constructor(){super(),this.name="Tip menu",this.total=20,this.settings=[{type:"choice",name:"tipmenu_enable",label:"Enable or disable the tip menu",choice1:"Enable",choice2:"Disable",defaultValue:"Enable"},{type:"choice",name:"tipmenu_sort",label:"Sort the tip menu",choice1:"Enable",choice2:"Disable",defaultValue:"Disable"},{type:"int",name:"tipmenu_interval",label:"Display interval (in minutes, 0 to disable)",minValue:0,maxValue:120,defaultValue:5},{type:"str",name:"tipmenu_color",label:"Tip menu text color (hex)",defaultValue:i.colors.dark_aqua},{type:"str",name:"tipmenu_bg",label:"Tip menu background color (hex)",defaultValue:i.colors.light_aqua},{type:"str",name:"tipmenu_tip_color",label:"New tip text color (hex)",defaultValue:i.colors.dark_purple},{type:"str",name:"tipmenu_tip_bg",label:"New tip background color (hex)",defaultValue:i.colors.white},{type:"str",name:"tipmenu_prefix",label:"Tip menu prefix",required:!1}];for(let e=0;e<this.total;e++){let s={type:"str",name:"tipmenu_"+(e+1),label:"Item #"+(e+1),required:!1,defaultValue:0===e?"12, tip item name":""};this.settings.push(s)}this.commands={tipmenu:{handler:this.tipmenu,description:"Show tip menu",params:/(.+)/},menu:{access:["host","mod"],handler:this.menu,description:"Do menu stuff",params:/(.+)/,subcommands:[{names:["start","on"],description:'Start the tip menu with "/menu start" or "/menu on"',handler:this.enable,success:"Tip menu started."},{names:["stop","off"],description:'Stop the tip menu with "/menu stop" or "/menu off"',handler:this.disable,success:"Tip menu stopped."},{names:["list","show"],description:"Alias to /tipmenu",handler:this.showTipMenu,success:"Tip menu listed."},{names:["sort"],description:'Sort the tip menu with "/menu sort"',handler:this.sortTipMenu,success:"Tip menu sorted by price."},{names:["unsort"],description:'Reset sorting of the tip menu with "/menu unsort"',handler:this.unsortTipMenu,success:"Tip menu reset to default order."},{names:["reset"],description:'Reset the tip menu to default settings with "/menu reset"',handler:this.initTipMenu,success:"Tip menu reset to default settings."},{names:["add","new"],description:'Add a tip menu item with "/menu add 123 New menu item"',handler:this.addMenuItem,success:"Tip menu item added."},{names:["edit","change"],description:'Edit tip menu item with "/menu edit 123 New menu item"',handler:this.editMenuItem,success:"Tip menu item updated."},{names:["price"],description:'Edit tip menu item price with "/menu price 123 234"',handler:this.priceMenuItem,success:"Tip menu item price updated."},{names:["remove","rm","del"],description:'Remove tip menu item with "/menu remove 123"',handler:this.removeMenuItem,success:"Tip menu item removed."},{names:["interval"],description:'Set notice interval in minutes with "/menu interval 3"',handler:this.setInterval,success:"Tip menu notice interval set."}]}},this.keyed={},this.items=[],this.prices=[],this.prefix=i.chars.text_star,this.enabled=!0,this.interval=3e5}enable(){this.enabled=!0}disable(){this.enabled=!1}setInterval(e,s){this.interval=6e4*Number.parseInt(s.join(""),10)}showInterval(){this.enabled&&0!==this.interval&&(this.showTipMenu(),this.api.setTimeout(function(){this.showInterval()}.bind(this),this.interval))}initTipMenu(){let e={},s=[],t=[];for(let i=0;i<this.total;i++){let n=this.api.settings["tipmenu_"+(i+1)];if(!n)continue;n=n.split(",");let a=Number.parseInt(n.shift().trim(),10),o=n.join(" ").trim();o&&a&&(s.push({name:o,price:a}),Object.assign(e,{[a]:o}),t.push(a))}this.keyed=e,this.items=s,this.prices=t}sortTipMenu(){this.items.sort((e,s)=>e.price-s.price)}unsortTipMenu(){let e=[];for(let s of this.prices)e.push({name:this.keyed[s],price:s});this.items=e}showTipMenu(e,s){let t=[],i=e?e.name:"";e&&e.hasPermission(["host","mod"])&&s&&"all"===s.join("").trim()&&(i="");for(let e of this.items)t.push(this.prefix+" "+e.name+" - "+e.price+" tokens");!this.enabled&&e&&e.hasPermission(["host","mod"])&&t.push('Tip menu is currently disabled. You can enable it with "/menu on"'),this.api.sendNotice(t.join("\n"),i,this.api.settings.tipmenu_bg,this.api.settings.tipmenu_color,"bold")}addMenuItem(e,s){let t=Number.parseInt(s.shift(),10),i=s.join(" ");if(this.prices.includes(t))return`Menu item already exists with a price of ${t} tokens. Edit or remove ${this.keyed[t]}`;Object.assign(this.keyed,{[t]:i}),this.items.push({name:i,price:t}),this.prices.push(t),"Enable"===this.api.settings.tipmenu_sort&&this.sortTipMenu()}editMenuItem(e,s){let t=Number.parseInt(s.shift(),10),i=s.join(" ");if(!this.prices.includes(t))return`Menu item does not exist with a price of ${t} tokens.`;let n=this.items.findIndex(e=>e.price===t);n>-1&&(this.items[n].name=i),this.keyed[t]=i}priceMenuItem(e,s){let t=Number.parseInt(s.shift(),10),i=Number.parseInt(s,10);if(!this.prices.includes(t))return`Menu item does not exist with a price of ${t} tokens.`;let n=this.items.findIndex(e=>e.price===t);n>-1&&(this.items[n].price=i),n=this.prices.indexOf(t),n>-1&&(Object.assign(this.keyed,{[i]:this.keyed[t]}),this.prices[n]=i,delete this.keyed[t],"Enable"===this.api.settings.tipmenu_sort&&this.sortTipMenu())}removeMenuItem(e,s){let t=Number.parseInt(s,10);if(!this.prices.includes(t))return`Menu item does not exist with a price of ${t} tokens.`;let i=this.items.findIndex(e=>e.price===t);i>-1&&this.items.splice(i,1),i=this.prices.indexOf(t),i>-1&&this.prices.splice(i,1),delete this.keyed[t]}onStart(){this.initTipMenu(),"Enable"===this.api.settings.tipmenu_sort&&this.sortTipMenu(),"Enable"!==this.api.settings.tipmenu_enable&&(this.enabled=!1),this.api.settings.tipmenu_prefix&&(this.prefix=this.api.settings.tipmenu_prefix),this.interval=6e4*Number.parseInt(this.api.settings.tipmenu_interval,10),this.interval>0&&this.showInterval(),this.api.log("Tip menu has started.")}onTip(e,s,t,i){this.enabled&&this.prices.includes(Number.parseInt(t,10))&&this.api.sendNotice((e.isAnon?"Anonymous":e.name)+" tipped for "+this.keyed[t],"",this.api.settings.tipmenu_tip_bg,this.api.settings.tipmenu_tip_color,"bold")}onEnter(e){this.enabled&&this.showTipMenu(e)}getStatus(){return`${this.name}: ${this.enabled?"[ running ]":"[ stopped ]"} Notice every ${this.interval/6e4} minute${this.interval>1?"s":""} - Available commands:`}tipmenu(e,s){this.enabled||e.hasPermission(["host","mod"])?this.showTipMenu(e,s):this.api.sendNotice("Tip menu is currently disabled.",e.name,i.colors.light_red)}}},function(e,s,t){let i=t(0).constants,n=t(0).pluginAbstract;e.exports=class extends n{constructor(){super(),this.name="Whispers",this.settings=[{type:"choice",name:"whispers_enable",label:"Enable or disable whispers",choice1:"Enable",choice2:"Disable",defaultValue:"Enable"}],this.commands={whispers:{access:["host","mod"],handler:this.whispers,description:"Do whispers stuff",params:/(.+)/,subcommands:[{names:["start","on"],description:'Enable whispers with "/whispers start" or "/whispers on"',handler:this.enable,success:"Whispers started."},{names:["stop","off"],description:'Disable whispers with "/whispers stop" or "/whispers off"',handler:this.disable,success:"Whispers stopped."},{names:["list","show"],description:'List whisperers with "/whispers list"',handler:this.showUsers,success:"Whisperers listed."},{names:["add","new"],description:'Add a whisperer with "/whispers add username"',handler:this.addUser,success:"Whisperer added."},{names:["remove","rm","del"],description:'Remove a whisperer with "/whispers remove username"',handler:this.removeUser,success:"Whisperer removed."}]},w:{access:["host","mod"],handler:this.whisperAll,description:"Whisper to mods and broadcaster",params:/(.+)/},wb:{access:["host","mod"],handler:this.whisperHost,description:"Whisper to broadcaster only",params:/(.+)/},wm:{access:["host","mod"],handler:this.whisperMods,description:"Whisper to mods only",params:/(.+)/}},this.mods=[],this.enabled=!0}enable(){this.enabled=!0}disable(){this.enabled=!1}showUsers(e){this.api.sendNotice("Whisperers: "+this.mods.join(", "),e.name,i.colors.white,i.colors.dark_red,"bold")}addUser(e,s){let t=s.join("").trim();if(this.mods.includes(t)){if(e.name!==t)return t+" already added."}else this.mods.push(t),this.api.sendNotice("You've been added to the whisperers list. Shh.",t,i.colors.dark_grey,i.colors.light_grey,"bold")}removeUser(e,s){let t=s.join("").trim(),i=this.mods.indexOf(t);if(i<0)return t+" is not amongst whisperers.";this.mods.splice(i,1)}onStart(){"Enable"!==this.api.settings.whispers_enable&&(this.enabled=!1)}onEnter(e){e.isMod&&!this.mods.includes(e.name)&&this.addUser(e,[e.name])}whisperAll(e,s){this.whisperHost(e,s,!0),this.whisperMods(e,s,!0)}whisperMods(e,s,t){if(!this.enabled)return;let n=`whisper from ${e.name}${!0!==t?" to mods":""}: ${s.trim()}`;if(this.mods.length>0)for(let e of this.mods)this.api.sendNotice(n,e,i.colors.dark_grey,i.colors.light_grey,"bold")}whisperHost(e,s,t){if(!this.enabled)return;let n=`whisper from ${e.name}${!0!==t?" to you":""}: ${s.trim()}`;this.api.sendNotice(n,this.api.room_slug,i.colors.dark_grey,!0!==t?i.colors.white:i.colors.light_grey,"bold"),!0!==t&&this.api.sendNotice(`whispered to ${this.api.room_slug}: ${s.trim()}`,e.name,i.colors.dark_grey,i.colors.light_grey,"bold")}getStatus(){return`${this.name}: ${this.enabled?"[ running ]":"[ stopped ]"} - Available commands:`}}}]);
© Copyright Chaturbate 2011- 2025. All Rights Reserved.