Bots Home
|
Create an App
I Have no Menu
Author:
patoso_dev
Description
Source Code
Launch Bot
Current Users
Created by:
Patoso_Dev
/** Name: I Have No Menu Author: patoso_ Creation Date: 24/02/2023 Actual Version: developping **/ /** Based on ideas and portions of code from: - kmoore (Tip Thank You bot) - badbadbubba (Tip menu) - MissLayla_ (Tip Menu of MissLayla_) - 4science (Tip Menu 4sci) - phredo (NoMenuBot) Functionality - Send welcome message when user enter the room. Selectable and modificable - Responds to /menu and /tipmenu indicating that there is no menu. Displays one or more of the 5 possible messages - It is possible to change the background color of the messages sent to the chat - The BOT can send a notice to the broadcaster when a user requests the menu. Selectable Warning Since this BOT manages the requests of the users through the /menu and /tipmenu commands, this BOT should not be used at the same time as other BOT's that manage tip menus **/ /** Change Log 1.0 (24/02/2023) Initial release version **/ var HEART = '\u2665'; // ♥ var NBSP = '\u00A0'; // Non break space var separator = ' ' + HEART + ' '; cb.settings_choices = [ {name: 'use_message_when_enter', label: 'Display a message for users when they enter the room?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'message_when_enter', label: 'Enter the welcome message you would like to show in chat (only visible for user who enters)([user] = nick of user, [model] = name of model room)', type: 'str', minLength: 1, maxLength: 1000, defaultValue: 'Hello [user]. Welcome to my room'}, {name: 'gif_when_enter', label: 'Enter the name of GIF/Image you would like to show in second line of welcome message. Left empty or type none to disable', type: 'str', minLength: 1, maxLength: 30, required: false, defaultValue: 'none'}, {name: 'use_msg1_nomenu', label: 'Display message #1 for users when they type /menu?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'msg1_nomenu', label: 'Enter the message #1 you would like to show when user type /menu', type: 'str', minLength: 1, maxLength: 500, defaultValue: 'No menu. Just goals and Roll the Dice (33tk)'}, {name: 'use_msg2_nomenu', label: 'Display message #2 for users when they type /menu?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'msg2_nomenu', label: 'Enter the message #2 you would like to show when user type /menu', type: 'str', minLength: 1, maxLength: 500, defaultValue: 'No menu. Just goals, Roll the Dice (33tk) or screen menu (2 jumps = 30tk)'}, {name: 'use_msg3_nomenu', label: 'Display message #3 for users when they type /menu?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'msg3_nomenu', label: 'Enter the message #3 you would like to show when user type /menu', type: 'str', minLength: 1, maxLength: 500, defaultValue: 'No menu. Just goals, Roll the Dice (33tk) or screen menu (2 jumps = 30tk or doggy = 40tk)'}, {name: 'use_msg4_nomenu', label: 'Display message #4 for users when they type /menu?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'msg4_nomenu', label: 'Enter the message #4 you would like to show when user type /menu', type: 'str', minLength: 1, maxLength: 500, defaultValue: 'aditional field'}, {name: 'use_msg5_nomenu', label: 'Display message #5 for users when they type /menu?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'msg5_nomenu', label: 'Enter the message #5 you would like to show when user type /menu', type: 'str', minLength: 1, maxLength: 500, defaultValue: 'aditional field'}, {name: 'send_request_notice', label: 'Send /menu request notice to moderators and broadcaster?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'bg_color', label: 'Background color', type: 'choice', choice1: 'Cadet Blue', choice2: 'Dark Khaki', choice3: 'Dark Sea Green', choice4: 'Light Coral', choice5: 'Light Green', choice6: 'Light Pink', choice7: 'Plum', choice8: 'Silver', choice9: 'Tan', choice10: 'White', defaultValue: 'Light Pink'}, {name: 'fb_color', label: 'Text color', type: 'choice', choice1: 'Black', choice2: 'White', defaultValue: 'Black'} ] var colours = { 'Cadet Blue': "#5f9ea0", 'Dark Khaki': "#bdb76b", 'Dark Sea Green': "#8fbc8f", 'Light Coral': "#f08080", 'Light Green': "#90ee90", 'Light Pink': "#ffb6c1", 'Plum': "#dda0dd", 'Silver': "#c0c0c0", 'Tan': "#d2b48c", 'White': "#ffffff", 'Black': "#000000" } var color_background_message = colours[cb.settings.bg_color]; var color_background_notice = colours['Light Green']; var color_text_message = colours[cb.settings.fb_color]; var help_text = "Commands available for No Menu Bot.\n" + "/nomenucolors: Shows an example of the background colors available for messages in chat. IMPORTANT: Color names shown are actual in CB light mode. In dark mode the colors are changed by the site.\n" + "/nomenuwelcome: Show an example of the Welcome to room message.\n" + "/nomenuhelp: Show this help.\n" + "This list of commands is only available for broadcaster and moderators."; function sendWelcome(user) { var str = ""; str = cb.settings.message_when_enter; str = str.replace("[user]", user); str = str.replace("[model]", cb.room_slug); if (cb.settings.gif_when_enter !== '' && cb.settings.gif_when_enter !== 'none') { cb.sendNotice(separator + str + '\n ' + cb.settings.gif_when_enter + ' ' + NBSP +' \n ' + NBSP, user, color_background_message, color_text_message); } else { cb.sendNotice(separator + str + NBSP, user, color_background_message, color_text_message); } } cb.onMessage(function(m) { if (m.m.charAt(0) === "/") { let u = m.user; let message = m.m.split(" "); let isMod = (cb.room_slug === u || m.is_mod); switch (message[0]) { case "/tipmenu": case "/menutip": case "/menu": case "/TIPMENU": case "/MENUTIP": case "/MENU": case "/smenu": case "/stipmenu": { m['X-Spam'] = true; //m.background = '#e9afaf'; let message = ""; let first = true; if (cb.settings.use_msg1_nomenu == "Yes") { if (first) { first = false; } message += separator + cb.settings.msg1_nomenu + NBSP; } if (cb.settings.use_msg2_nomenu == "Yes") { if (first) { first = false; } else { message += NBSP + '\n'; } message += separator + cb.settings.msg2_nomenu; } if (cb.settings.use_msg3_nomenu == "Yes") { if (first) { first = false; } else { message += NBSP + '\n'; } message += separator + cb.settings.msg3_nomenu; } if (cb.settings.use_msg4_nomenu == "Yes") { if (first) { first = false; } else { message += NBSP + '\n'; } message += separator + cb.settings.msg4_nomenu; } if (cb.settings.use_msg5_nomenu == "Yes") { if (first) { first = false; } else { message += NBSP + '\n'; } message += separator + cb.settings.msg5_nomenu; } if (message !== '') { cb.sendNotice(message, u, color_background_message, color_text_message); } if (cb.settings.send_request_notice == "Yes") { cb.sendNotice(separator + u + ' has requested the tip menu' + NBSP, cb.room_slug, color_background_notice, color_text_message, 'red'); } return m; } case "/nomenucolors": { if (isMod) { m['X-Spam'] = true; for (str in colours) { if (str != "Black") { cb.sendNotice("Test color: " + str + NBSP + "\n second test line" + NBSP, u, colours[str], color_text_message); } } } return m; } case "/nomenuwelcome": { if (isMod) { m['X-Spam'] = true; sendWelcome(u); } return m; } case "/nomenuhelp": { if (isMod) { m['X-Spam'] = true; cb.sendNotice(help_text, u, color_background_message, color_text_message); } return m; } default: { return m; } } } return m; }); cb.onEnter(function(user) { let isMod = (cb.room_slug === user.user || user.is_mod); if (cb.settings.use_message_when_enter == "Yes" && !isMod) { sendWelcome(user['user']); } });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.