Bots Home
|
Create an App
Dorothy's Notices and Room Rules
Author:
dorothy
Description
Source Code
Launch Bot
Current Users
Created by:
Dorothy
/** Name: Dorothy's Notice and Room Rules Author: butter_my_toast Created: 03/25/2021 See Change Log on bot description page for revision history **/ //** Enable for ESLINT syntax check, Disable for CB compile //var cb = ''; //var cbjs = ''; let t01brightrainbow = 'linear-gradient(to right, #ff6767, #ffdb9a, #ffff9d, #5fd85f, #9f9fff, #ff9bff)'; let t02pastelrainbow = 'linear-gradient(to right, #ff9a9a, #ffe4b4, #ffffb4, #bfd9bf, #add8e6, #e0d6f4)'; let t03valentines = 'linear-gradient(to right bottom, #ff7373, #ffe1f1)'; let t04christmas = 'linear-gradient(to right bottom, #6bdb6b, #ff9a9a)'; let t05halloween = 'linear-gradient(to right bottom, #ffba67, #ffffb4)'; let t06blue = 'linear-gradient(to right bottom, #a9c4f5, #d4ebf2)'; let t07green = 'linear-gradient(to right bottom, #9fc69f, #cfe3cf)'; let t08pink = 'linear-gradient(to right bottom, #ffb6da, #ffe9ec)'; let t09purple = 'linear-gradient(to right bottom, #c1adea, #dfd5f5)'; let t10blackgray = 'linear-gradient(to right bottom, #c6c6c6, #ececec)'; let t11sunset = 'linear-gradient(to right, #9489c2, #c600fb, #ffa200, #c600fb, #9489c2)'; let t12abv = 'linear-gradient(to right bottom, #00e0ff, #c600fb, #9489c2)'; let t13rwb = 'linear-gradient(to right bottom, #ff0000, #ffffff, #0027c1)'; let t14stpat = 'linear-gradient(to right bottom, #0e7312, #c0e6c3, #0e7312)'; var themeArray = { name: ['None', 'Custom', 'Bright Rainbow', 'Pastel Rainbow', 'Valentines', 'Christmas', 'Halloween', 'Shades of Blue', 'Shades of Green', 'Shades of Pink', 'Shades of Purple', 'Black and Gray', 'Sunset', 'Aqua/Blue/Violet', 'Red/White/Blue', 'St Patrick\'s Day' ], shortcut: ['none', 'custom', 'brightrainbow', 'pastelrainbow', 'valentines', 'christmas', 'halloween', 'shadesblue', 'shadesgreen', 'shadespink', 'shadespurple', 'blackgray', 'sunset', 'aquablue', 'redwhiteblue', 'stpat' ], colorID: ['none', 'custom', t01brightrainbow, t02pastelrainbow, t03valentines, t04christmas, t05halloween, t06blue, t07green, t08pink, t09purple, t10blackgray, t11sunset, t12abv, t13rwb, t14stpat ], textcolor: ['#000000', '#000000', '#00008b', '#00008b', '#c7006b', '#ffffff', '#000000', '#00008b', '#006400', '#d00068', '#663399', '#000000', '#000000', '#d4ebf2', '#000000', '#024604' ]}; var textColorArray = { dispname: ['White/No Color', 'Black', 'Dark Grey', 'Dark Red', 'Dark Orange', 'Dark Green', 'Dark Aqua', 'Dark Blue', 'Dark Purple', 'Dark Pink', 'Dark Gold', 'Dark Teal', 'Dark Brown', 'Dark Bronze', 'Dark Periwinkle', 'Dark Fuschia', 'Dark Lime', 'Dark Plum' ], name: ['white', 'black', 'darkgrey', 'darkred', 'darkorange', 'darkgreen', 'darkaqua', 'darkblue', 'darkpurple', 'darkpink', 'darkgold', 'darkteal', 'darkbrown', 'darkbronze', 'darkperiwinkle', 'darkfuschia', 'darklime', 'darkplum' ], colorID: ['#FFFFFF', '#000000', '#737373', '#cc0000', '#e77400', '#006600', '#006767', '#0629AC', '#3d003d', '#FF6680', '#998100', '#003f1f', '#582c00', '#a56728', '#155bd7', '#d6155c', '#6b790c', '#7f13bf' ]}; var bgColorArray = { dispname: ['White/No Color', 'Light Yellow', 'Light Blue', 'Light Pink', 'Light Red', 'Light Green', 'Light Purple', 'Light Orange', 'Light Grey', 'Light Aqua', 'Light Teal', 'Cream', 'Light Bronze', 'Light Periwinkle', 'Light Fuschia', 'Light Lime', 'Light Plum'], name: ['white', 'lightyellow', 'lightblue', 'lightpink', 'lightred', 'lightgreen', 'lightpurple', 'lightorange', 'lightgrey', 'lightaqua', 'lightteal', 'cream', 'lightbronze', 'lightperiwinkle', 'lightfuschia', 'lightlime', 'lightplum' ], colorID: ['#FFFFFF', '#ffff94', '#d1eaee', '#FFE6EA', '#ff9a9a', '#94e594', '#f2cdff', '#ffd9b3', '#e6e6e6', '#adeaea', '#d7fbee', '#f9f6ed', '#ebccad', '#d7e4fb', '#fbd7e4', '#ecf6a7', '#e3c0f9' ]}; cb.settings_choices = [ {name: 'dummy0', label: '---------------------------------------------------------------------------------------------------- Latest Updt: April 3, 2021 (version 1.1) See Change Log for details ----------------------------------------------------------------------------------------------------', type: 'choice',required: false}, {name: 'dummy00', label: 'Welcome ' + cb.room_slug + '! You can see the full list of commands for this Notifier Bot by typing "/nfhelp" in the chat (no quotes), and then also see more detailed help by section. The full command list is also on the bot description page. Please enjoy using the bot and feel free to say hello if you see us around, or DM us on twitter @thechelsea2950 if you have questions. Thank you! - chelsea & butter_my_toast', type: 'choice',required: false}, // *** Messages and Notifications {name: 'dummy1', label: '---------------------------------------------------------------------------------------------------- SECTION 1 - Welcome Messages and Notifications', type: 'choice',required: false}, {name: 'enableEntryMessage', label: '1A. Enable a "Welcome" message?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'Yes'}, {name: 'entryMessage', label: '1B. "Welcome" message text -- Note that you can include the substitution text {username} within your welcome text to have the username of the person joining the room show in the welcome message. Just make sure there is a space on either side of {username} so that it is recognized (a comma immediately following is ok). The substitution identifier {n} can also be inserted into the message to force a break to a new line (must also be separated from other text and punctuation by a space)', type: 'str', required: false, minLength: 1, maxLength: 1000, defaultValue: 'Welcome {username} to my room! {n} Please have a great time and treat your fellow chatters with kindness. {n} Rude comments and demands will not be tolerated.'}, {name: 'notifierEnable', label: '1C. Enable Rotating Notifier?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'notifierInterval', label: '1D. Rotating Notifier display interval -- Defined in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = one minute 30 second intervals.', type: 'str', defaultValue: 3.1, required: false}, {name: 'dummy1A', label: 'Rotating Notices -- Up to 20 messages can be displayed in rotation according to the interval specified below. The substitution text {n} can be inserted into each notifier to force a break to a new line (must be separated from other text and punctuation by a space)', type: 'choice', required: false}, {name: 'notifierMessage1', label: '1F1. Notification Message #1', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage2', label: '1F2. Notification Message #2', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage3', label: '1F3. Notification Message #3', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage4', label: '1F4. Notification Message #4', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage5', label: '1F5. Notification Message #5', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage6', label: '1F6. Notification Message #6', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage7', label: '1F7. Notification Message #7', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage8', label: '1F8. Notification Message #8', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage9', label: '1F9. Notification Message #9', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage10', label: '1F10. Notification Message #10', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage11', label: '1F11. Notification Message #11', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage12', label: '1F12. Notification Message #12', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage13', label: '1F13. Notification Message #13', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage14', label: '1F14. Notification Message #14', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage15', label: '1F15. Notification Message #15', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage16', label: '1F16. Notification Message #16', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage17', label: '1F17. Notification Message #17', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage18', label: '1F18. Notification Message #18', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage19', label: '1F19. Notification Message #19', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'notifierMessage20', label: '1F20. Notification Message #20', required: false,type: 'str', minLength: 1, maxLength: 1000}, {name: 'dummy1B', label: 'Colors for Rotating Notifier messages and Welcome Message. Note that even if defined here, if a color theme is selected in setting "4A" the theme will override these selections (see Personalization section 4). If configuring custom colors, use the hex color code (6 character hex color ID code including the "#" prefix)', type: 'choice', required: false}, {name: 'notifierTextColor', label: '1G1. Text color', type: 'choice', choice1: textColorArray.dispname[0],choice2: textColorArray.dispname[1],choice3: textColorArray.dispname[2],choice4: textColorArray.dispname[3],choice5: textColorArray.dispname[4],choice6: textColorArray.dispname[5],choice7: textColorArray.dispname[6],choice8: textColorArray.dispname[7],choice9: textColorArray.dispname[8],choice10: textColorArray.dispname[9],choice11: textColorArray.dispname[10],choice12: textColorArray.dispname[11],choice13: textColorArray.dispname[12],choice14: textColorArray.dispname[13],choice15: textColorArray.dispname[14],choice16: textColorArray.dispname[15],choice17: textColorArray.dispname[16],choice18: textColorArray.dispname[17],choice19: 'Custom', defaultValue: textColorArray.dispname[6]}, {name: 'notifierTextCustColor', label: '1G2. Custom Text color -- If you picked "custom" in the previous setting, enter the hex code here', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'notifierBgColor', label: '1G3. Background Color', type: 'choice', choice1: bgColorArray.dispname[0],choice2: bgColorArray.dispname[1],choice3: bgColorArray.dispname[2],choice4: bgColorArray.dispname[3],choice5: bgColorArray.dispname[4],choice6: bgColorArray.dispname[5],choice7: bgColorArray.dispname[6],choice8: bgColorArray.dispname[7],choice9: bgColorArray.dispname[8],choice10: bgColorArray.dispname[9],choice11: bgColorArray.dispname[10],choice12: bgColorArray.dispname[11],choice13: bgColorArray.dispname[12],choice14: bgColorArray.dispname[13],choice15: bgColorArray.dispname[14],choice16: bgColorArray.dispname[15],choice17: bgColorArray.dispname[16],choice18: 'Custom', defaultValue: bgColorArray.dispname[9]}, {name: 'notifierBgCustColor', label: '1G4. Custom Background Color -- If you picked "custom" in the previous setting, enter the hex code here', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Room Rules {name: 'dummy2', label: '---------------------------------------------------------------------------------------------------- SECTION 2 - ROOM RULES', type: 'choice',required: false}, {name: 'dummy2A', label: 'Define up to 8 rules that will be displayed. If enabled, the rules will be shown to every user when they enter the room, and can also be displayed on the chat on a recurring basis if you define a timer. Note that the "Next line" feature can be triggered the substitution text {n}, just make sure to leave spaces on either side of it', type: 'choice', required: false}, {name: 'roomRulesEnable', label: '2A. Display on User Entry?', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'roomRulesInterval', label: '2B. Room Rules display interval -- Defined in minutes, leave at zero to disable the recurring message (will still be shown when they enter based on "enable" setting above). Decimals are ok as long as they are greater than 1. For example, 1.5 = one minute 30 second intervals.', type: 'str', defaultValue: 7.3, required: false}, {name: 'roomRule1', label: '2C1. Rule #1', required: false,type: 'str', minLength: 0, maxLength: 200, defaultValue: 'Rule #1: No Demanding! Please put all sexy talk and requests in a tip note.'}, {name: 'roomRule2', label: '2C2. Rule #2', required: false,type: 'str', minLength: 0, maxLength: 200, defaultValue: 'Rule #2: Please be kind to everyone in my room or risk being silenced.'}, {name: 'roomRule3', label: '2C3. Rule #3', required: false,type: 'str', minLength: 0, maxLength: 200}, {name: 'roomRule4', label: '2C4. Rule #4', required: false,type: 'str', minLength: 0, maxLength: 200}, {name: 'roomRule5', label: '2C5. Rule #5', required: false,type: 'str', minLength: 0, maxLength: 200}, {name: 'roomRule6', label: '2C6. Rule #6', required: false,type: 'str', minLength: 0, maxLength: 200}, {name: 'roomRule7', label: '2C7. Rule #7', required: false,type: 'str', minLength: 0, maxLength: 200}, {name: 'roomRule8', label: '2C8. Rule #8', required: false,type: 'str', minLength: 0, maxLength: 200}, {name: 'roomRule9', label: '2C9. Rule #9', required: false,type: 'str', minLength: 0, maxLength: 200}, {name: 'roomRule10', label: '2C10. Rule #10', required: false,type: 'str', minLength: 0, maxLength: 200}, {name: 'dummy2B', label: 'Colors for Room Rules notice. Note that even if defined here, if a color theme is selected in setting "4A" the theme will override these selections (see Personalization section 4). If configuring custom colors, use the hex color code (6 character hex color ID code including the "#" prefix)', type: 'choice', required: false}, {name: 'roomRulesTextColor', label: '2D1. Text Color', type: 'choice', choice1: textColorArray.dispname[0],choice2: textColorArray.dispname[1],choice3: textColorArray.dispname[2],choice4: textColorArray.dispname[3],choice5: textColorArray.dispname[4],choice6: textColorArray.dispname[5],choice7: textColorArray.dispname[6],choice8: textColorArray.dispname[7],choice9: textColorArray.dispname[8],choice10: textColorArray.dispname[9],choice11: textColorArray.dispname[10],choice12: textColorArray.dispname[11],choice13: textColorArray.dispname[12],choice14: textColorArray.dispname[13],choice15: textColorArray.dispname[14],choice16: textColorArray.dispname[15],choice17: textColorArray.dispname[16],choice18: textColorArray.dispname[17],choice19: 'Custom', defaultValue: textColorArray.dispname[4]}, {name: 'roomRulesTextCustColor', label: '2D2. Custom Text Color -- If you picked "custom" in the previous setting, enter the hex code here', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'roomRulesBgColor', label: '2D3. Background Color', type: 'choice', choice1: bgColorArray.dispname[0],choice2: bgColorArray.dispname[1],choice3: bgColorArray.dispname[2],choice4: bgColorArray.dispname[3],choice5: bgColorArray.dispname[4],choice6: bgColorArray.dispname[5],choice7: bgColorArray.dispname[6],choice8: bgColorArray.dispname[7],choice9: bgColorArray.dispname[8],choice10: bgColorArray.dispname[9],choice11: bgColorArray.dispname[10],choice12: bgColorArray.dispname[11],choice13: bgColorArray.dispname[12],choice14: bgColorArray.dispname[13],choice15: bgColorArray.dispname[14],choice16: bgColorArray.dispname[15],choice17: bgColorArray.dispname[16],choice18: 'Custom', defaultValue: bgColorArray.dispname[7]}, {name: 'roomRulesBgCustColor', label: '2D4. Custom Background Color -- If you picked "custom" in the previous setting, enter the hex code here', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** Media Platforms {name: 'dummy3', label: '---------------------------------------------------------------------------------------------------- SECTION 3 - MEDIA LIST', type: 'choice',required: false}, {name: 'dummy3A', label: 'Use this section provide all of your social media, wish lists, website, and other contact information in one place. You can use a recurring notice, and also send the list to the chat on commandby typing: /medialist. Default text is put in as an example, but you can edit and delete any that you do not use. You can use the default gifs (such as :twitter_30x30) or find or create your own, or use emojis to brighten up the messaging. You can put them in the description or the value', type: 'choice', required: false}, {name: 'mediaListEnable', label: '3A. Enable the posting of your contact info and media platforms detailed below? Note you can also turn the notice on and off during the show using the "/media on" and "/media off" commands.', type: 'choice', choice1: 'Yes', choice2: 'No', defaultValue: 'No'}, {name: 'mediaListInterval', label: '3B. Media List Notice display interval in minutes. Decimals are ok as long as they are greater than 1. For example, 1.5 = one minute 30 second intervals.', type: 'str', defaultValue: 5.7, required: false}, {name: 'mediaListIntro', label: '3C. Enter the Text you would like to show at the beginning of the media list to introduce the list to the user. "Next line" feature enabled with {n}.', required: false, defaultValue: 'Contact info is below for scheduling privates, shopping on amazon wishlist, and staying in touch through my various social media platforms:', type: 'str', minLength: 1, maxLength: 255}, {name: 'mediaSameLine', label: '3D. Print the media type text and actual link or ID on the same line or separate lines?', type: 'choice', choice1: 'Same Line', choice2: 'Separate Lines', defaultValue: 'Same Line'}, {name: 'mediaListText1', label: '3E1. Text for Item 1',type: 'str',defaultValue: 'E-mail Address',required: false}, {name: 'mediaListItem1', label: '3E2. Item 1',type: 'str',defaultValue: 'abc@email.com',required: false}, {name: 'mediaListText2', label: '3E3. Text for Item 2',type: 'str',defaultValue: 'Personal Website',required: false}, {name: 'mediaListItem2', label: '3E4. Item 2',type: 'str',defaultValue: 'http://abc.web.com',required: false}, {name: 'mediaListText3', label: '3E5. Text for Item 3',type: 'str',defaultValue: 'Twitter ID',required: false}, {name: 'mediaListItem3', label: '3E6. Item 3',type: 'str',defaultValue: ':twitter_30x30 @Twitter',required: false}, {name: 'mediaListText4', label: '3E7. Text for Item 4',type: 'str',defaultValue: 'Instagram ID',required: false}, {name: 'mediaListItem4', label: '3E8. Item 4',type: 'str',defaultValue: ':inst_30x30 @Instagram',required: false}, {name: 'mediaListText5', label: '3E9. Text for Item 5',type: 'str',defaultValue: 'Public Snapchat ID',required: false}, {name: 'mediaListItem5', label: '3E10. Item 5',type: 'str',defaultValue: ':snapchat_30x30 @snapID',required: false}, {name: 'mediaListText6', label: '3E11. Text for Item 6',type: 'str',defaultValue: 'Amazon Wishlist',required: false}, {name: 'mediaListItem6', label: '3E12. Item 6',type: 'str',defaultValue: ':AmazonWLSml http://amazon.com/user',required: false}, {name: 'mediaListText7', label: '3E13. Text for Item 7',type: 'str',defaultValue: 'Video sales site',required: false}, {name: 'mediaListItem7', label: '3E14. Item 7',type: 'str',defaultValue: 'link to site',required: false}, {name: 'mediaListText8', label: '3E15. Text for Item 8',type: 'str',defaultValue: 'External Fan Club',required: false}, {name: 'mediaListItem8', label: '3E16. Item 8',type: 'str',defaultValue: 'fanclub_30x30 http://onlyfans.com/userID',required: false}, {name: 'mediaListText9', label: '3E17. Text for Item 9',type: 'str',defaultValue: 'Misc Link 1',required: false}, {name: 'mediaListItem9', label: '3E18. Item 9',type: 'str',defaultValue: 'Insert Link 1',required: false}, {name: 'mediaListText10', label: '3E19. Text for Item 10',type: 'str',defaultValue: 'Misc Link 2',required: false}, {name: 'mediaListItem10', label: '3E20. Item 10',type: 'str',defaultValue: 'Insert Link 2',required: false}, {name: 'mediaListText11', label: '3E21. Text for Item 11',type: 'str',defaultValue: 'Misc Link 3',required: false}, {name: 'mediaListItem11', label: '3E22. Item 11',type: 'str',defaultValue: 'Insert Link 3',required: false}, {name: 'mediaListText12', label: '3E23. Text for Item 12',type: 'str',defaultValue: 'Misc Link 4',required: false}, {name: 'mediaListItem12', label: '3E24. Item 12',type: 'str',defaultValue: 'Insert Link 4',required: false}, {name: 'dummy3B', label: 'Colors for Media List notice. Note that even if defined here, if a color theme is selected in setting "4A" the theme will override these selections (see Personalization section 4). If configuring custom colors, use the hex color code (6 character hex color ID code including the "#" prefix)', type: 'choice', required: false}, {name: 'mediaListTextColor', label: '3F1. Text Color', type: 'choice', choice1: textColorArray.dispname[0],choice2: textColorArray.dispname[1],choice3: textColorArray.dispname[2],choice4: textColorArray.dispname[3],choice5: textColorArray.dispname[4],choice6: textColorArray.dispname[5],choice7: textColorArray.dispname[6],choice8: textColorArray.dispname[7],choice9: textColorArray.dispname[8],choice10: textColorArray.dispname[9],choice11: textColorArray.dispname[10],choice12: textColorArray.dispname[11],choice13: textColorArray.dispname[12],choice14: textColorArray.dispname[13],choice15: textColorArray.dispname[14],choice16: textColorArray.dispname[15],choice17: textColorArray.dispname[16],choice18: textColorArray.dispname[17],choice19: 'Custom', defaultValue: textColorArray.dispname[9]}, {name: 'mediaListCustTextColor', label: '3F2. Custom Text Color -- If you picked "custom" in the previous setting, enter the hex code here', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'mediaListBgColor', label: '3F3. Background Color', type: 'choice', choice1: bgColorArray.dispname[0],choice2: bgColorArray.dispname[1],choice3: bgColorArray.dispname[2],choice4: bgColorArray.dispname[3],choice5: bgColorArray.dispname[4],choice6: bgColorArray.dispname[5],choice7: bgColorArray.dispname[6],choice8: bgColorArray.dispname[7],choice9: bgColorArray.dispname[8],choice10: bgColorArray.dispname[9],choice11: bgColorArray.dispname[10],choice12: bgColorArray.dispname[11],choice13: bgColorArray.dispname[12],choice14: bgColorArray.dispname[13],choice15: bgColorArray.dispname[14],choice16: bgColorArray.dispname[15],choice17: bgColorArray.dispname[16],choice18: 'Custom', defaultValue: bgColorArray.dispname[3]}, {name: 'mediaListCustBgColor', label: '3F4. Custom Background Color -- If you picked "custom" in the previous setting, enter the hex code here', type: 'str', minLength: 1, maxLength: 7, required: false}, // *** General Settings {name: 'dummy4', label: '---------------------------------------------------------------------------------------------------- SECTION 4 - GENERAL SETTINGS & PERSONALIZATION', type: 'choice',required: false}, {name: 'dummy4A', label: 'This section is new and will be expanded in the future with additional themes and colors to further personalize how the bot looks for your room.', type: 'choice', required: false}, {name: 'colorTheme', label: '4A. Use a color theme in all recurring notice text backgrounds? -- This will trigger all background highlighting in the different recurring notices to follow the same color theme. If choosing "none" (default), the colors defined in each individual bot feature section are used. If choosing one of the existing themes or a custom theme, the individual color settings will be overridden and the theme colors will be used for all recurring notices (does not include user chat or bot responses and warnings). When choosing "Custom Linear", enter your chosen colors below in settings 4B1-4B4. Note that if a specific theme is used, it will always show a diagonal gradient, and setting "4C" below is ignored', type: 'choice', choice1: themeArray.name[0], choice2: themeArray.name[1], choice3: themeArray.name[2], choice4: themeArray.name[3], choice5: themeArray.name[4], choice6: themeArray.name[5], choice7: themeArray.name[6], choice8: themeArray.name[7], choice9: themeArray.name[8], choice10: themeArray.name[9], choice11: themeArray.name[10], choice12: themeArray.name[11], choice13: themeArray.name[12], choice14: themeArray.name[13], choice15: themeArray.name[14], choice16: themeArray.name[15], choice17: themeArray.name[16], defaultValue: themeArray.name[7]}, {name: 'colorThemeCustBg1', label: '4B1. Custom Color 1 - If you picked "Custom Linear" color theme above in setting "4A", enter the hex color code for background color 1 ("#" prefix plus the 6 character hex color codes, such #ffffff)', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'colorThemeCustBg2', label: '4B2. Custom Color 2 - If you picked "Custom Linear" color theme above in setting "4A", enter the hex color code for background color 2, it will default to white (#ffffff) if none is chosen as two colors are required', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'colorThemeCustBg3', label: '4B3. Custom Color 3 - If you picked "Custom Linear" color theme above in setting "4A", enter the hex color code for background color 3 (optional)', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'colorThemeCustText', label: '4B4. Custom Text Color - If you picked "Custom Linear" color theme above in setting "4A", enter the hex color code for text - it will default to white if none is chosen', type: 'str', minLength: 1, maxLength: 7, required: false}, {name: 'colorsGradientDirection', label: '4C. Use a color gradient (gradual fade from one color to another) in all recurring notice backgrounds? -- This will trigger all background highlighting in the different recurring notices to follow a similar gradient pattern. If choosing "Linear" for the gradual color change (from the defined color to white), you can also choose the direction of the fade - left right, top to bottom, or diagonal. Note that the gradient setting only affects the shading pattern, the actual colors used are defined either in the individual bot feature sections or overriden above in setting "4A" or "4B1-3". Also note that if a pre-configured color theme is used above, the gradient direction is unique to the theme and this gradient setting will be ignored', type: 'choice', choice1: 'No', choice2: 'Linear, left to right', choice3: 'Linear, top to bottom', choice4: 'Linear, diagonally', defaultValue: 'Linear, diagonally'}, {name: 'noticeSepStyle', label: '4D1. Notice Border Style -- This control how the top and bottom border of several of the recurring notices is displayed. You can choose from the defined options here, or use the below setting for "4D2" to define your own emoji or other character. Depending on the type you choose, the spacing of the border will be different, so be sure to select the matching type here for the emoji or character you set below.', type: 'choice', choice1: 'No Border', choice2: 'Light Dashed Line', choice3: 'Heavy Dashed Line', choice4: 'Custom Emoji Below', choice5: 'Custom Unicode Character Below', defaultValue: 'Light Dashed Line'}, {name: 'borderChar', label: '4D2. Notice Border emoji or text/unicode character -- For an emoji or unicode character, paste the actual emoji/image here, not the code (not \u2580 for example). Note that most unicode characters have the benfit of being the same color as your text. The borders are currently used for leaderboard, media info, room rules, dice game, and icon tip notices. Do NOT use a CB icon here, if you do, it will default to "Heavy Dashed Line". You can use the command /setbrdsep to update the emoji separator during your show and play around with them to find one that has the color and spacing you are looking for.', type: 'str', minLength: 0, maxLength: 2, required: false}, {name: 'textWrapLength', label: '4E. Set the number of characters at which to wrap a long line of text to next line. Same setting is used in the welcome message, notifier, room rules, and media list intro. Default is 80 as that typically fits the width of the border for recurring notices, and must be at least 25 or set to zero to disable automatic line wrapping. Values from 1-24 will default to 25', type: 'int', minValue: 0, maxValue: 120, defaultValue: 80} ]; // *********************************** Variables and Arrays ************************************** var initialize = 0; var BC = cb.room_slug; var botName = 'Notices Bot:'; var borderChar = cb.settings.borderChar; var borderCharSpacing = ''; var notifierToggle = false; var mediaToggle = false; var roomRuleToggle = false; var colorTheme = cb.settings.colorTheme; var wrapMaxLength = cb.settings.textWrapLength; var maxNotifierMsgLength = 0; //Colors var textPollBgColor = ''; var textPollTextColor = ''; var noticeBgColor = ''; var noticeTextColor = ''; var roomRulesBgColor = ''; var roomRulesTextColor = ''; var mediaBgColor = ''; var mediaTextColor = ''; var appNoticeColor = '#a2dfac'; // Used for general Notice messaging (green) var appWarningColor = '#f4d599'; // Used for general Warning messaging (yellow) var borderNotifierTop = ''; var borderNotifierBottom = ''; var borderRulesTop = ''; var borderRulesBottom = ''; var borderMediaTop = ''; var borderMediaBottom = ''; var borderWelcomeTop = ''; var borderWelcomeBottom = ''; var notifierRotateCount = 0; var notifierTotalCount = 0; var notifierInt = 0; var notifierMessage1 = cb.settings.notifierMessage1; var notifierMessage2 = cb.settings.notifierMessage2; var notifierMessage3 = cb.settings.notifierMessage3; var notifierMessage4 = cb.settings.notifierMessage4; var notifierMessage5 = cb.settings.notifierMessage5; var notifierMessage6 = cb.settings.notifierMessage6; var notifierMessage7 = cb.settings.notifierMessage7; var notifierMessage8 = cb.settings.notifierMessage8; var notifierMessage9 = cb.settings.notifierMessage9; var notifierMessage10 = cb.settings.notifierMessage10; var notifierMessage11 = cb.settings.notifierMessage11; var notifierMessage12 = cb.settings.notifierMessage12; var notifierMessage13 = cb.settings.notifierMessage13; var notifierMessage14 = cb.settings.notifierMessage14; var notifierMessage15 = cb.settings.notifierMessage15; var notifierMessage16 = cb.settings.notifierMessage16; var notifierMessage17 = cb.settings.notifierMessage17; var notifierMessage18 = cb.settings.notifierMessage18; var notifierMessage19 = cb.settings.notifierMessage19; var notifierMessage20 = cb.settings.notifierMessage20; var mediaTimerInt = 0; var mediaListIntro = ''; var mediaListItem1 = cb.settings.mediaListItem1; var mediaListItem2 = cb.settings.mediaListItem2; var mediaListItem3 = cb.settings.mediaListItem3; var mediaListItem4 = cb.settings.mediaListItem4; var mediaListItem5 = cb.settings.mediaListItem5; var mediaListItem6 = cb.settings.mediaListItem6; var mediaListItem7 = cb.settings.mediaListItem7; var mediaListItem8 = cb.settings.mediaListItem8; var mediaListItem9 = cb.settings.mediaListItem9; var mediaListItem10 = cb.settings.mediaListItem10; var mediaListItem11 = cb.settings.mediaListItem11; var mediaListItem12 = cb.settings.mediaListItem12; var mediaListText1 = cb.settings.mediaListText1; var mediaListText2 = cb.settings.mediaListText2; var mediaListText3 = cb.settings.mediaListText3; var mediaListText4 = cb.settings.mediaListText4; var mediaListText5 = cb.settings.mediaListText5; var mediaListText6 = cb.settings.mediaListText6; var mediaListText7 = cb.settings.mediaListText7; var mediaListText8 = cb.settings.mediaListText8; var mediaListText9 = cb.settings.mediaListText9; var mediaListText10 = cb.settings.mediaListText10; var mediaListText11 = cb.settings.mediaListText11; var mediaListText12 = cb.settings.mediaListText12; var roomRulesInt = 0; var roomRule1 = cb.settings.roomRule1; var roomRule2 = cb.settings.roomRule2; var roomRule3 = cb.settings.roomRule3; var roomRule4 = cb.settings.roomRule4; var roomRule5 = cb.settings.roomRule5; var roomRule6 = cb.settings.roomRule6; var roomRule7 = cb.settings.roomRule7; var roomRule8 = cb.settings.roomRule8; var roomRule9 = cb.settings.roomRule9; var roomRule10 = cb.settings.roomRule10; var noticeOnlyBC = botName + ' Only broadcasters are able to use that command.'; var noticeOnlyBCMod1 = botName + ' Only broadcasters and moderators are able to use that command.'; // Arrays */ var notifierArray = []; var roomRulesArray = []; var mediaListArray = {name: [], desc: []}; // *********************************** Initialize ************************************** if (initialize == 0) { cb.sendNotice('Dorothys Notices and Room Rules v1.1'); let intromessage = '\u26D4 Version 1.1 was released on April 3, 2021 \u26D4'; intromessage += '\n \u2705 Please use the command "/about" to see the highlights for the current version and recent previous releases, or you can read the full list on the bot description page:'; intromessage += '\n \u2705 https://chaturbate.com/apps/app_details/dorothys-notices-and-room-rules/ '; intromessage += '\n \u2705 Reminder: You can type "/nfhelp" to display the full command list, or use one of the group qualifiers to see more details within a group, such as "/nfhelp notices"'; cb.sendNotice(intromessage, BC); //** Word Wrap width if (wrapMaxLength > 0 && wrapMaxLength < 25) { wrapMaxLength = 25; cb.sendNotice(botName + ' The Word Wrap width is too small, must be at least 25 if not set to zero, defaulting to 25.', BC, appNoticeColor); } for (let notinitidx = 1; notinitidx <= 20; notinitidx++) { if (this['notifierMessage'+(notinitidx)]) { notifierArray.push(this['notifierMessage'+(notinitidx)]); let thismsgln = this['notifierMessage'+(notinitidx)].length; if (thismsgln > maxNotifierMsgLength) { maxNotifierMsgLength = thismsgln; } } } for (let rrinitidx = 1; rrinitidx <= 10; rrinitidx++) { if (this['roomRule'+(rrinitidx)]) { roomRulesArray.push(this['roomRule'+(rrinitidx)]); } } for (let medinitidx = 1; medinitidx <= 12; medinitidx++) { if (this['mediaListText'+medinitidx] && this['mediaListItem'+medinitidx]) { mediaListArray.name.push(this['mediaListText'+medinitidx]); mediaListArray.desc.push(this['mediaListItem'+medinitidx]); } } if (colorTheme == 'None') { loadAllFeatureColors(BC); } else { loadThemeColors(BC); } noticeBorderChar(); if (cb.settings.notifierEnable == 'Yes') { if (notifierArray.length > 0) { notifierSetToggle('on',BC,false); } else { cb.sendNotice(botName + ' Warning! Notifier was enabled, but no notifications are configured, disabling the notifier. You can use the command "/chgmsg" to add notifiers and then turn on notifications again with "/notifier on", or you can restart the bot and configure at least one notifier.', BC, appNoticeColor); } } if (cb.settings.mediaListEnable == 'Yes') { if (mediaListArray.name.length > 0) { mediaSetToggle('on',BC,false); } else { cb.sendNotice(botName + ' Warning! Media List was enabled, but no entries are configured, disabling the Media List display.', BC, appNoticeColor); } } if (cb.settings.roomRulesEnable == 'Yes') { if (roomRulesArray.length > 0) { roomRulesSetToggle('on',BC,false); } else { cb.sendNotice(botName + ' Warning! The Room Rules were enabled, but no entries are configured, disabling the Room Rules List display.', BC, appNoticeColor); } } initialize = 1; } // Generic functions to set the color or separator characters function loadAllFeatureColors(loadfeatby) { notifierSetColors(loadfeatby); mediaSetColors(loadfeatby); roomRulesSetColors(loadfeatby); } function loadThemeColors(loadthemeby) { let tempthemebgcolor = setThemeBgColor(loadthemeby); let tempthemetextcolor = setThemeTextColor(loadthemeby); textPollBgColor = tempthemebgcolor; textPollTextColor = tempthemetextcolor; noticeBgColor = tempthemebgcolor; noticeTextColor = tempthemetextcolor; roomRulesBgColor = tempthemebgcolor; roomRulesTextColor = tempthemetextcolor; mediaBgColor = tempthemebgcolor; mediaTextColor = tempthemetextcolor; } function customizeColorTheme(newcolortheme,newthemesendto) { if (cbjs.arrayContains(themeArray.shortcut,newcolortheme)) { var themeindex = themeArray.shortcut.indexOf(newcolortheme); if (newcolortheme == 'custom') { if (cb.settings.colorThemeCustBg1) { if (cb.settings.colorThemeCustText) { colorTheme = 'Custom'; cb.sendNotice('You have updated the color theme to "Custom".', newthemesendto, appNoticeColor, ''); setThemeBgColor(newthemesendto); setThemeTextColor(newthemesendto); } else { cb.sendNotice('You have requested a custom color theme, but a custom text color is not defined in setting "4B4".', newthemesendto, appNoticeColor, ''); } } else { cb.sendNotice('You have requested a custom color theme, but at least one custom color is not defined in setting "4B1".', newthemesendto, appNoticeColor, ''); } } else { colorTheme = themeArray.name[themeindex]; setThemeBgColor(newthemesendto); setThemeTextColor(newthemesendto); cb.sendNotice('You have updated the color theme to "' + colorTheme + '".', newthemesendto, appNoticeColor, ''); } } else { cb.sendNotice('Invalid color theme name. The valid names are: \n' + cbjs.arrayJoin(themeArray.shortcut, ', '), newthemesendto, appNoticeColor, ''); } } function setThemeTextColor(sttcsendto) { var selectedthemetextcolor = '#000000'; if (colorTheme == 'Custom') { var temptextcolor = cb.settings.colorThemeCustText; if (/^#[0-9A-F]{6}$/i.test(temptextcolor)) { selectedthemetextcolor = temptextcolor; } else if (/^[0-9A-F]{6}$/i.test(temptextcolor)) { selectedthemetextcolor = '#' + temptextcolor; } else { cb.sendNotice(botName + ' ' + temptextcolor + ' - Error while setting the text color. It must be in a HEX code format. Using default value of black text.', sttcsendto, appNoticeColor); } } else { if (cbjs.arrayContains(themeArray.name,colorTheme)) { let themeidx = themeArray.name.indexOf(colorTheme); return themeArray.textcolor[themeidx]; } else { cb.sendNotice(botName + ' Warning! Invalid theme setting of "' + colorTheme + '". \nDefaulting to no theme used.', sttcsendto, appWarningColor); colorTheme = 'None'; } } return selectedthemetextcolor; } function setThemeBgColor(setthemeby) { var selectedthemebgcolor = '#FFFFFF'; if (colorTheme == 'Custom') { var graddir = ''; if (cb.settings.colorsGradientDirection == 'Linear, left to right') { graddir = 'to right'; } else if (cb.settings.colorsGradientDirection == 'Linear, top to bottom') { graddir = 'to bottom'; } else if (cb.settings.colorsGradientDirection == 'Linear, diagonally') { graddir = 'to right bottom'; } else if (cb.settings.colorsGradientDirection == 'No') { graddir = 'to right bottom'; } var themecustbg1 = ''; var themecustbg2 = ''; var themecustbg3 = ''; if (cb.settings.colorThemeCustBg1) { if (/^#[0-9A-F]{6}$/i.test(cb.settings.colorThemeCustBg1)) { themecustbg1 = cb.settings.colorThemeCustBg1; } else if (/^[0-9A-F]{6}$/i.test(cb.settings.colorThemeCustBg1)) { themecustbg1 = '#' + cb.settings.colorThemeCustBg1; } else { cb.sendNotice(botName + ' Warning! Custom color theme selected but Background 1 is not in the correct hex color code format. \nDefaulting to no theme used.', setthemeby, appWarningColor); colorTheme = 'None'; } } else { cb.sendNotice(botName + ' Warning! Custom color theme selected but Background 1 is not configured. \nDefaulting to no theme used.', setthemeby, appWarningColor); colorTheme = 'None'; } if (cb.settings.colorThemeCustBg2) { if (/^#[0-9A-F]{6}$/i.test(cb.settings.colorThemeCustBg2)) { themecustbg2 = cb.settings.colorThemeCustBg2; } else if (/^[0-9A-F]{6}$/i.test(cb.settings.colorThemeCustBg2)) { themecustbg2 = '#' + cb.settings.colorThemeCustBg2; } else { themecustbg2 = '#FFFFFF'; cb.sendNotice(botName + ' Warning! Custom color theme selected but Background 2 is not configured with a proper hex color code. \nDefaulting second color to white.', setthemeby, appWarningColor); } } else { themecustbg2 = '#FFFFFF'; cb.sendNotice(botName + ' Warning! Custom color theme selected but Background 2 is not configured. \nAt least two colors are required, defaulting second color to white.', setthemeby, appWarningColor); } var numbercustcolors = 2; if (cb.settings.colorThemeCustBg3) { numbercustcolors = 3; if (/^#[0-9A-F]{6}$/i.test(cb.settings.colorThemeCustBg3)) { themecustbg3 = cb.settings.colorThemeCustBg3; } else if (/^[0-9A-F]{6}$/i.test(cb.settings.colorThemeCustBg3)) { themecustbg3 = '#' + cb.settings.colorThemeCustBg3; } else { themecustbg3 = '#FFFFFF'; } } if (colorTheme != 'None') { if (numbercustcolors == 2) { selectedthemebgcolor = 'linear-gradient(' + graddir + ', ' + themecustbg1 + ', ' + themecustbg2 + ')'; } else { selectedthemebgcolor = 'linear-gradient(' + graddir + ', ' + themecustbg1 + ', ' + themecustbg2 + ', ' + themecustbg3 + ')'; } } } else { if (cbjs.arrayContains(themeArray.name,colorTheme)) { let themeidx = themeArray.name.indexOf(colorTheme); selectedthemebgcolor = themeArray.colorID[themeidx]; } else { cb.sendNotice(botName + ' Warning! Invalid theme setting of "' + colorTheme + '". \nDefaulting to no theme used.', setthemeby, appWarningColor); colorTheme = 'None'; } } return selectedthemebgcolor; } function setTextColor(inputtextcolor,inputtextcolortype,inputtextcolorsendto) { var selectedtextcolor = '#FFFFFF'; if (cbjs.arrayContains(textColorArray.dispname,inputtextcolor)) { var txtclridx = textColorArray.dispname.indexOf(inputtextcolor); selectedtextcolor = textColorArray.colorID[txtclridx]; } else { if (/^#[0-9A-F]{6}$/i.test(inputtextcolor)) { selectedtextcolor = inputtextcolor; } else if (/^[0-9A-F]{6}$/i.test(inputtextcolor)) { selectedtextcolor = '#' + inputtextcolor; } else { cb.sendNotice(botName + ' ' + inputtextcolortype + ' - Error while setting the text color. It must be in a HEX code format. Using default value of black text.', inputtextcolorsendto, appNoticeColor); } } return selectedtextcolor; } function setBgColor(inputbgcolor,inputbgcolortype,inputbgcolorsendto) { var selectedbgcolor = '#FFFFFF'; if (cbjs.arrayContains(bgColorArray.dispname,inputbgcolor)) { var clridx = bgColorArray.dispname.indexOf(inputbgcolor); selectedbgcolor = bgColorArray.colorID[clridx]; } else { if (/^#[0-9A-F]{6}$/i.test(inputbgcolor)) { selectedbgcolor = inputbgcolor; } else if (/^[0-9A-F]{6}$/i.test(inputbgcolor)) { selectedbgcolor = '#' + inputbgcolor; } else { cb.sendNotice(botName + ' ' + inputbgcolortype + ' - Error while setting the background color. It must be in a HEX code format. Using default value of white/no background.', inputbgcolorsendto, appNoticeColor); } } if (selectedbgcolor != '#FFFFFF') { if (cb.settings.colorsGradientDirection == 'Linear, left to right') { selectedbgcolor = 'linear-gradient(to right, ' + selectedbgcolor + ', #FFFFFF)'; } else if (cb.settings.colorsGradientDirection == 'Linear, top to bottom') { selectedbgcolor = 'linear-gradient(to bottom, ' + selectedbgcolor + ', #FFFFFF)'; } else if (cb.settings.colorsGradientDirection == 'Linear, diagonally') { selectedbgcolor = 'linear-gradient(to right bottom, ' + selectedbgcolor + ', #FFFFFF)'; } } return selectedbgcolor; } //********** Word Wrap and Next Line Functions ************** function checkNextLine(nlmessage) { var nlmessagearray = nlmessage.split(' '); var nllinearray = []; var templinearray = []; var lineidx = 0; var currlineidx = 0; var nlreplace = false; var nlsubfound = true; while (nlsubfound) { if (cbjs.arrayContains(nlmessagearray,'{n}')) { let nlmsgindex = nlmessagearray.indexOf('{n}'); nlmessagearray[nlmsgindex] = '\n'; templinearray = nlmessagearray.slice(currlineidx,nlmsgindex); nllinearray[lineidx] = wordWrap(cbjs.arrayJoin(templinearray,' ')); templinearray = nlmessagearray.slice(nlmsgindex+1); nllinearray[lineidx+1] = wordWrap(cbjs.arrayJoin(templinearray,' ')); lineidx++; currlineidx = nlmsgindex+1; nlreplace = true; } else { nlsubfound = false; } } if (nlreplace) { return cbjs.arrayJoin(nllinearray,'\n'); } else { return wordWrap(nlmessage); } } function wordWrap(wrapstring) { if (wrapMaxLength > 0) { let newlinechar = '\n'; let splitstring = ''; while (wrapstring.length > wrapMaxLength) { let spacefound = false; for (var wwidx = wrapMaxLength - 1; wwidx >= 0; wwidx--) { if (testWhite(wrapstring.charAt(wwidx))) { splitstring = splitstring + [wrapstring.slice(0, wwidx), newlinechar].join(''); wrapstring = wrapstring.slice(wwidx + 1); spacefound = true; break; } } if (!spacefound) { splitstring += [wrapstring.slice(0, wrapMaxLength), newlinechar].join(''); wrapstring = wrapstring.slice(wrapMaxLength); } } return splitstring + wrapstring; } else { return wrapstring; } } function testWhite(whitestring) { var white = new RegExp(/^\s$/); return white.test(whitestring.charAt(0)); } //********** Check Username Function ************** function checkUsername(chkusrmessage,chkuser) { let responsemessagearray = chkusrmessage.split(' '); let chkusrreplace = false; if (cbjs.arrayContains(responsemessagearray,'{username}')) { let chkusrmsgindex = responsemessagearray.indexOf('{username}'); responsemessagearray[chkusrmsgindex] = chkuser; chkusrreplace = true; } else if (cbjs.arrayContains(responsemessagearray,'{username},')) { let chkusrmsgindex = responsemessagearray.indexOf('{username},'); responsemessagearray[chkusrmsgindex] = chkuser + ','; chkusrreplace = true; } else if (cbjs.arrayContains(responsemessagearray,'{username}!')) { let chkusrmsgindex = responsemessagearray.indexOf('{username}!'); responsemessagearray[chkusrmsgindex] = chkuser + '!'; chkusrreplace = true; } else if (cbjs.arrayContains(responsemessagearray,'{username}:')) { let chkusrmsgindex = responsemessagearray.indexOf('{username}:'); responsemessagearray[chkusrmsgindex] = chkuser + ':'; chkusrreplace = true; } else if (cbjs.arrayContains(responsemessagearray,'{username}.')) { let chkusrmsgindex = responsemessagearray.indexOf('{username}.'); responsemessagearray[chkusrmsgindex] = chkuser + '.'; chkusrreplace = true; } if (chkusrreplace) { return cbjs.arrayJoin(responsemessagearray,' '); } else { return chkusrmessage; } } //********** Build Repeating Char Lines ************** function noticeBorderChar() { if (cb.settings.noticeSepStyle == 'Custom Emoji Below') { borderCharSpacing = 'emoji'; if (borderChar) { if (borderChar.includes(':') || borderChar.includes('\\')) { cb.sendNotice(botName + ' You have configured configured the notice border style as "Custom Emoji" but the value contains ":" or "\\" (CB gifs are not allowed). Defaulting to an emoji of Heavy Dashed Line " \u2796 ".', BC, appWarningColor); borderChar = '\u2796'; } } else { borderChar = '\u2796'; cb.sendNotice(botName + ' You have configured configured the notice border style as "Custom Emoji" but an emoji is not defined. Defaulting to an emoji of Heavy Dashed Line " \u2796 ".', BC, appWarningColor); } } else if (cb.settings.noticeSepStyle == 'Custom Unicode Character Below') { borderCharSpacing = 'unicode'; if (borderChar) { if (borderChar.includes(':')) { cb.sendNotice(botName + ' You have configured configured the notice border style as "Custom Unicode Character" but the value contains ":" (CB gifs are not allowed). Defaulting to a character of Heavy Dashed Line " \u268A ".', BC, appWarningColor); borderChar = '\u268A'; } } else { borderChar = '\u268A'; cb.sendNotice(botName + ' You have configured configured the notice border style as "Custom Unicode Character" but a character is not defined. Defaulting to a character of Heavy Dashed Line " \u268A ".', BC, appWarningColor); } } else if (cb.settings.noticeSepStyle == 'Heavy Dashed Line') { borderCharSpacing = 'unicode'; borderChar = '\u268A'; } else if (cb.settings.noticeSepStyle == 'Light Dashed Line') { borderCharSpacing = 'light'; borderChar = '-'; } else { borderCharSpacing = 'none'; } switch (borderCharSpacing) { case 'emoji': if (maxNotifierMsgLength > 45) { borderNotifierTop = noticeBorder('top','',12,false,true); borderNotifierBottom = noticeBorder('bottom','',12,false,true); } else { borderNotifierTop = noticeBorder('top','\u2666',8,false,true); borderNotifierBottom = noticeBorder('bottom','',8,false,true); } borderRulesTop = noticeBorder('top','ROOM RULES',10,false,true); borderRulesBottom = noticeBorder('bottom','',12,false,true); borderMediaTop = noticeBorder('top','MEDIA INFO',10,false,true); borderMediaBottom = noticeBorder('bottom','',12,false,true); borderWelcomeTop = noticeBorder('top','WELCOME',10,true,true); borderWelcomeBottom = noticeBorder('bottom','',12,false,true); break; case 'unicode': if (maxNotifierMsgLength > 45) { borderNotifierTop = noticeBorder('top','\u2666',21,false,false); borderNotifierBottom = noticeBorder('bottom','',21,false,false); } else { borderNotifierTop = noticeBorder('top','\u2666',12,false,false); borderNotifierBottom = noticeBorder('bottom','',12,false,false); } borderRulesTop = noticeBorder('top','ROOM RULES',18,true,false); borderRulesBottom = noticeBorder('bottom','',22,false,false); borderMediaTop = noticeBorder('top','MEDIA INFO',19,false,false); borderMediaBottom = noticeBorder('bottom','',22,false,false); borderWelcomeTop = noticeBorder('top','WELCOME',19,true,false); borderWelcomeBottom = noticeBorder('bottom','',22,false,false); break; case 'light': if (maxNotifierMsgLength > 45) { borderNotifierTop = noticeBorder('top','\u2666',48,false,false); borderNotifierBottom = noticeBorder('bottom','',48,false,false); } else { borderNotifierTop = noticeBorder('top','\u2666',31,false,false); borderNotifierBottom = noticeBorder('bottom','',31,false,false); } borderRulesTop = noticeBorder('top','ROOM RULES',40,true,false); borderRulesBottom = noticeBorder('bottom','',48,false,false); borderMediaTop = noticeBorder('top','MEDIA INFO',41,false,false); borderMediaBottom = noticeBorder('bottom','',48,false,false); borderWelcomeTop = noticeBorder('top','WELCOME',42,true,false); borderWelcomeBottom = noticeBorder('bottom','',48,false,false); break; case 'none': borderNotifierTop = ''; borderRulesTop = noticeBorder('top','ROOM RULES:',0,false,false); borderMediaTop = noticeBorder('top','MEDIA INFO:',0,false,false); borderWelcomeTop = noticeBorder('top','WELCOME:',0,false,false); break; } } function noticeBorder(bordertopbtm,bordertext,bordernumchar,bordernumaddone,borderdispspace) { let outcharstring = ''; let halfcharstring = ''; let midchar = '\u2666'; let dispnumber = 0; if (borderCharSpacing == 'none') { if (bordertopbtm == 'top') { outcharstring = bordertext; } } else { for (let charidx = 1; charidx <= bordernumchar; charidx++) { if (borderdispspace) { halfcharstring += borderChar + ' '; } else { halfcharstring += borderChar; } } if (bordertopbtm == 'top') { outcharstring += halfcharstring + ' ' + bordertext + ' ' + halfcharstring; if (bordernumaddone) { outcharstring += borderChar; } } else if (bordertopbtm == 'bottom') { if (borderdispspace) { outcharstring += halfcharstring + halfcharstring; } else { outcharstring += halfcharstring + ' ' + midchar + ' ' + halfcharstring; } } } return outcharstring; } //********** Notifier Functions ************** function notifierSetToggle(nstmode,nstsendto,nstbycmd) { if (nstmode == 'on') { if (notifierToggle) { cb.sendNotice(botName + ' The Notifier toggle is already turned on.', nstsendto, appNoticeColor); } else { notifierToggle = true; notifierRotateCount = 1; notifierTotalCount = 1; notifierInitTimer(); if (nstbycmd) { cb.sendNotice(botName + ' You have enabled the display of the rotating notifier messages.', nstsendto, appNoticeColor); } } } else if (nstmode == 'off') { if (!notifierToggle) { cb.sendNotice(botName + ' The Notifier toggle is already turned off.', nstsendto, appNoticeColor); } else { notifierToggle = false; cb.sendNotice(botName + ' You have disabled the display of the rotating notifier messages.', nstsendto, appNoticeColor); } } } function notifierSetColors(nscby) { if (cb.settings.notifierTextColor == 'Custom') { noticeTextColor = setTextColor(cb.settings.notifierTextCustColor,'Notifiers',nscby); } else { noticeTextColor = setTextColor(cb.settings.notifierTextColor,'Notifiers',nscby); } if (cb.settings.notifierBgColor == 'Custom') { noticeBgColor = setBgColor(cb.settings.notifierBgCustColor,'Notifiers',nscby); } else { noticeBgColor = setBgColor(cb.settings.notifierBgColor,'Notifiers',nscby); } } function notifierInitTimer() { if (isNaN(parseFloat(cb.settings.notifierInterval))) { cb.sendNotice(botName + ' Notifier interval is not set with a valid number so the Notifier is not enabled.', BC, appWarningColor); notifierInt = 0; } else { notifierInt = parseFloat(cb.settings.notifierInterval); } if (notifierInt != 0) { if (notifierInt < 1) { cb.sendNotice(botName + ' Notifier interval is too short, it must be at least 1. Using a default value of 1.9 minutes.', BC, appNoticeColor); notifierInt = 1.9; } notifierInt = parseInt(notifierInt * 60000) cb.setTimeout(notifierDisplay,notifierInt); } } function notifierDisplay() { if (notifierToggle) { if (notifierRotateCount > 20) { notifierRotateCount = 1; } if (notifierArray[notifierRotateCount-1]) { displayOneNotifier(notifierRotateCount-1); notifierRotateCount++; cb.setTimeout(notifierDisplay,notifierInt); } else { if (notifierArray.length > 0) { notifierRotateCount = 1; notifierDisplay(); } else { cb.sendNotice(botName + ' Warning! Notifier was enabled, but no notifications are configured, disabling the notifier. You can use the command "/chgmsg" to add notifiers and then turn on notifications again with "/notifier on", or you can restart the bot and configure at least one notifier.', BC, appNoticeColor); notifierToggle = false; } } } } function displayOneNotifier(notenum) { let notifiermsg = ''; if (cb.settings.noticeSepStyle != 'No Border') { notifiermsg += borderNotifierTop + '\n'; } notifiermsg += checkNextLine(notifierArray[notenum]); if (cb.settings.noticeSepStyle != 'No Border') { notifiermsg += '\n' + borderNotifierBottom; } cb.sendNotice(notifiermsg, '', noticeBgColor, noticeTextColor, 'bold'); } //********** Room Rules Functions ************** function roomRulesSetToggle(mode, mod, bycmd) { if (mode == 'on') { if (roomRuleToggle) { cb.sendNotice(botName + ' The Room Rules toggle is already turned on.', mod, appNoticeColor); } else { roomRuleToggle = true; roomRulesInitTimer(); if (bycmd) { cb.sendNotice(botName + ' You have enabled the display of the Room Rules messages.', mod, appNoticeColor); } } } else if (mode == 'off') { if (!roomRuleToggle) { cb.sendNotice(botName + ' The Room Rules toggle is already turned off.', mod, appNoticeColor); } else { roomRuleToggle = false; cb.sendNotice(botName + ' You have disabled the display of the Room Rules messages.', mod, appNoticeColor); } } } function roomRulesSetColors(rrscby) { if (cb.settings.roomRulesTextColor == 'Custom') { roomRulesTextColor = setTextColor(cb.settings.roomRulesTextCustColor,'Room Rules',rrscby); } else { roomRulesTextColor = setTextColor(cb.settings.roomRulesTextColor,'Room Rules',rrscby); } if (cb.settings.roomRulesBgColor == 'Custom') { roomRulesBgColor = setBgColor(cb.settings.roomRulesBgCustColor,'Room Rules',rrscby); } else { roomRulesBgColor = setBgColor(cb.settings.roomRulesBgColor,'Room Rules',rrscby); } } function roomRulesInitTimer() { if (isNaN(parseFloat(cb.settings.roomRulesInterval))) { cb.sendNotice(botName + ' Room Rules notice interval is not set with a valid number so the Room Rules notice is not enabled.', BC, appWarningColor); roomRulesInt = 0; } else { roomRulesInt = parseFloat(cb.settings.roomRulesInterval); } if (roomRulesInt != 0) { if (roomRulesInt < 1) { cb.sendNotice(botName + ' Room Rules notice interval is too short, must be at least 1. Using a value of 5.5 minutes.', BC, appWarningColor); roomRulesInt = 5.5; } roomRulesInt = parseInt(roomRulesInt * 60000); cb.setTimeout(roomRulesTimer,roomRulesInt); } } function roomRulesTimer() { if (roomRuleToggle && roomRulesArray.length > 0) { roomRulesDisplay('','timer'); cb.setTimeout(roomRulesTimer,roomRulesInt); } } function roomRulesDisplay(rulessendto,rulesreqmode) { var rulemessage = borderRulesTop; if (rulesreqmode == 'cmd') { if (rulessendto == '') { rulemessage += '\n(Sent to ALL)'; } else { rulemessage += '\n(Sent to YOU)'; } } if (roomRulesArray.length > 0) { for (let ruleindex = 0; ruleindex < roomRulesArray.length; ruleindex++) { if (roomRulesArray[ruleindex]) { rulemessage += '\n' + checkNextLine(roomRulesArray[ruleindex]); } } } else { rulemessage += '\nNo Room Rules are configured'; } if (cb.settings.noticeSepStyle != 'No Border') { rulemessage += '\n' + borderRulesBottom; } cb.sendNotice(rulemessage, rulessendto, roomRulesBgColor, roomRulesTextColor, 'bold'); } // *********************************** Media Display Function ************************************** function mediaSetToggle(mode,mod,bycmd) { if (mode == 'on') { if (mediaToggle) { cb.sendNotice(botName + ' The Media List is already enabled.', mod, appNoticeColor); } else { mediaToggle = true; if (cb.settings.mediaListIntro) { mediaListIntro = checkNextLine(cb.settings.mediaListIntro); } mediaInitTimer(); if (bycmd) { cb.sendNotice(botName + ' You have enabled the Media List.', mod, appNoticeColor); } } } else if (mode == 'off') { if (!mediaToggle) { cb.sendNotice(botName + ' The Media List is already disabled.', mod, appNoticeColor); } else { mediaToggle = false; cb.sendNotice(botName + ' You have disabled the Media List.', mod, appNoticeColor); } } } function mediaSetColors(mscby) { if (cb.settings.mediaListTextColor == 'Custom') { mediaTextColor = setTextColor(cb.settings.mediaListCustTextColor,'Media List',mscby); } else { mediaTextColor = setTextColor(cb.settings.mediaListTextColor,'Media List',mscby); } if (cb.settings.mediaListBgColor == 'Custom') { mediaBgColor = setBgColor(cb.settings.mediaListCustBgColor,'Media List',mscby); } else { mediaBgColor = setBgColor(cb.settings.mediaListBgColor,'Media List',mscby); } } function mediaInitTimer() { if (isNaN(parseFloat(cb.settings.mediaListInterval))) { cb.sendNotice(botName + ' Media List notice interval is not set with a valid number so the Media List notice is not enabled.', BC, appWarningColor); mediaTimerInt = 0; } else { mediaTimerInt = parseFloat(cb.settings.mediaListInterval); } if (mediaTimerInt != 0) { if (mediaTimerInt < 1) { cb.sendNotice(botName + ' Media List notice interval is too short, must be at least 1 minute. Using default value of 5.7 minutes.', BC, appWarningColor); mediaTimerInt = 5.7; } mediaTimerInt = parseInt(mediaTimerInt * 60000); cb.setTimeout(mediaListTimer, mediaTimerInt); } } function mediaListTimer() { if (mediaToggle) { mediaDisplay('','timer'); cb.setTimeout(mediaListTimer, mediaTimerInt); } } function mediaDisplay(mediasendto,mediareqmode) { let mediamessage = borderMediaTop; if (mediareqmode == 'cmd') { if (mediasendto == '') { mediamessage += '\n(Sent to ALL)'; } else { mediamessage += '\n(Sent to YOU)'; } } mediamessage += '\n' + checkNextLine(mediaListIntro); for (let mlaidx = 1; mlaidx <= 12; mlaidx++) { if (mediaListArray.name[mlaidx-1]) { if (cb.settings.mediaSameLine == 'Same Line') { mediamessage += '\n \u2022 ' + mediaListArray.name[mlaidx-1] + ' : ' + mediaListArray.desc[mlaidx-1]; } else { mediamessage += '\n' + mediaListArray.name[mlaidx-1] + '\n \u2022 ' + mediaListArray.desc[mlaidx-1]; } } } if (cb.settings.noticeSepStyle != 'No Border') { mediamessage += '\n' + borderMediaBottom; } cb.sendNotice(mediamessage, mediasendto, mediaBgColor, mediaTextColor, 'bold'); } // *********************************** Help Function ************************************** function displayAbout(sendtoabout) { let aboutmessage = '\u23E9 Dorothy\'s Notices and Room Rules \u23EA'; aboutmessage += '\n \u2705 About the bot:'; aboutmessage += '\n \u2022 Version 1.1 was released on April 3, 2021 \u26D4'; aboutmessage += '\n \u2022' + wordWrap('Dorothy\'s Notices & Room Rules was written by CB users chelsea2950 and butter_my_toast'); aboutmessage += '\n \u2022' + wordWrap('Comments, suggestions, requests, and bug reports can be made by either tweeting @thechelsea2950, or by posting comments on bot help page.'); aboutmessage += '\n \u2022' + wordWrap('The purpose of this Bot is to provide several types of user messaging in one place if you are not using an UltraBot (like Dorothy\'s Ultra Fembot) that would do this, or if you need a longer set of notifiers.'); aboutmessage += '\n \u2022' + wordWrap('You can type "/nfhelp" to display the command list summary, and use one of the group qualifiers to see more details within a group, such as "/nfhelp notices"'); aboutmessage += '\n \u2022' + wordWrap('The bot description page includes extensive details on bot features, commands, and recent release notes:'); aboutmessage += '\n https://chaturbate.com/apps/app_details/dorothys-notices-and-room-rules/'; aboutmessage += '\n\n \u2705 Highlights of fixes and improvements for version 1.1:'; aboutmessage += '\n \u2022 General cleanup of notice border formatting'; cb.sendNotice(aboutmessage, sendtoabout, appWarningColor); } // ******************************* Upon user entry of a Message ************************************** cb.onMessage(function (msg) { let rawmsg = msg.m; let messagearray = msg.m.split(' '); let msguser = msg.user; let msgismod = msg.is_mod; let msgisbc = (msguser === BC); let command = messagearray[0]; let commandVar1 = parseInt(messagearray[1]); let commandVar2 = parseInt(messagearray[2]); if (messagearray[0].charAt(0) == '/') { msg['X-Spam'] = true; //******** Chat Control Commands *********** switch(command) { case '/chgint': { if (msgisbc || msgismod) { let newtimer = parseFloat(messagearray[2]); if (messagearray[1]) { let intervaltochange = messagearray[1].toLowerCase(); if (intervaltochange != 'notifier' && intervaltochange != 'rules' && intervaltochange != 'media' ) { cb.sendNotice(botName + ' The value entered for the notice type to change is invalid, please try again using one of these values of "notifier", "rules", or "media".', msguser, appNoticeColor); } else if (!messagearray[2]) { cb.sendNotice(botName + ' This command requires a parameter to define the new interval (in minutes), in the format "/chgint [notice type] [new interval]", where [new interval] is the new display interval in minutes. An example of a valid command would be "/chgint rules 7.2" to update the rules interval to 7.2 minutes.', msguser, appNoticeColor); } else if (isNaN(newtimer)) { cb.sendNotice(botName + ' The second parameter requires a numeric value to define the new interval (in minutes), in the format "/chgint [notice type] [new interval]", where [new interval] is the new display interval in minutes. An example of a valid command would be "/chgint rules 7.2" to update the rules interval to 7.2 minutes.', msguser, appNoticeColor); } else if (newtimer <= 1) { cb.sendNotice(botName + ' The new value for the timer interval must be at least "1" for 1 minute (such as 1, 3, 4.5, etc).', msguser, appNoticeColor); } else { let newtimerint = newtimer * 60000; newtimerint = parseInt(newtimerint); switch (intervaltochange) { case 'notifier': { notifierInt = newtimerint; break; } case 'media': { mediaTimerInt = newtimerint; break; } case 'rules': { roomRulesInt = newtimerint; break; } } cb.sendNotice(botName + ' The "' + intervaltochange + '" notice timer has been updated to a new interval of ' + newtimer + ' minutes. This will take effect after the next display of the notice.', msguser, appNoticeColor); } } else { cb.sendNotice(botName + ' This command requires a parameter to define to notice timer that is to be used, in the format "/chgint [notice type] [new interval]", where [notice type] is one of the defined values of "notifier", "rules", or "media", and [new interval] is the new interval in minutes. An example of a valid command would be "/chgint rules 3.2" to update the rules interval to 3.2 minutes.', msguser, appNoticeColor); } } else { cb.sendNotice(noticeOnlyBCMod1, msguser, appNoticeColor); } break; } case '/chgtheme': { if (msgisbc || msgismod) { if (messagearray[1]) { let newtheme = messagearray[1].toLowerCase(); customizeColorTheme(newtheme,msguser); } else { cb.sendNotice(botName + 'The /chgtheme command requires the entry of a parameter following the command, such as "/chgtheme pastelrainbow". The valid formats are: \n' + cbjs.arrayJoin(themeArray.shortcut, ', '), msguser, appNoticeColor); } } else { cb.sendNotice(noticeOnlyBCMod1, msguser, appNoticeColor); } break; } case '/setbrdsep': { if (msgismod || msgisbc) { if (cb.settings.noticeSepStyle == 'Heavy Dashed Line' || cb.settings.noticeSepStyle == 'Light Dashed Line' || cb.settings.noticeSepStyle == 'No Border') { cb.sendNotice(botName + ' The notice border character can only be updated if the bot is configured for a custom emoji or custom unicode character.', msguser, appNoticeColor); } else if (!messagearray[1]) { cb.sendNotice(botName + ' Parameter for new border separator is not specified.', msguser, appNoticeColor); } else { borderChar = messagearray[1]; noticeBorderChar(); cb.sendNotice(botName + ' Separator has been updated to " ' + borderChar + ' ".', msguser, appNoticeColor); } } else { cb.sendNotice(noticeOnlyBCMod1, msguser, appNoticeColor); } break; } case '/about': { displayAbout(msguser); break; } //********* Notifier Commands case '/notifier': { if (msgismod || msgisbc) { if (messagearray[1].toLowerCase() == 'on' || messagearray[1].toLowerCase() == 'off') { notifierSetToggle(messagearray[1],msguser,true); } else { cb.sendNotice(botName + ' You did not enter a valid parameter for /notifier, valid options are "on" or "off".', msguser, appNoticeColor); } } else { cb.sendNotice(noticeOnlyBCMod1,msguser,appNoticeColor); } break; } case '/chgmsg': { if (msgismod || msgisbc) { let chgmsgnum = parseInt(messagearray[1]); if (!messagearray[1]) { cb.sendNotice(botName + ' The first parameter must be the message number of the notifier you want to update, for example "/chgmsg 13 New Notice!". If you want to disable the notifications, type: /notifier off',msguser,appNoticeColor) } else if (isNaN(chgmsgnum)) { cb.sendNotice(botName + ' The first parameter must be the numeric value for the message number of the notifier you want to update, for example "/chgmsg 13 New Notice!". If you want to disable the notifications, type: /notifier off',msguser,appNoticeColor) } else if (chgmsgnum < 1 || chgmsgnum > 20) { cb.sendNotice(botName + ' The first parameter must be a number from 1 to 20 to indicate the message number of the notifier you want to update, for example "/chgmsg 13 New Notice!". If you want to disable the notifications, type: /notifier off',msguser,appNoticeColor) } else if (!messagearray[2]) { cb.sendNotice(botName + ' You must enter the new message text for the notifier you want to update, for example "/chgmsg 13 New Notice!". If you want to disable the notifications, type: /notifier off',msguser,appNoticeColor) } else { let chgmsgtext = ''; for (let msgtxtidx = 2; msgtxtidx < messagearray.length; msgtxtidx++) { if (msgtxtidx === 2) { chgmsgtext = messagearray[msgtxtidx]; } else { chgmsgtext += ' ' + messagearray[msgtxtidx]; } } let chgmsgindex = chgmsgnum - 1; notifierArray[chgmsgindex] = chgmsgtext; cb.sendNotice(botName + ' You have updated the message for Notifier entry ' + chgmsgnum + ' to "' + chgmsgtext + '".', msguser, appNoticeColor); if (msguser != BC) { cb.sendNotice(botName + ' ' + msguser + ' has updated the message for Notifier entry ' + chgmsgnum + ' to "' + chgmsgtext + '".', BC, appNoticeColor); } } } else { cb.sendNotice(noticeOnlyBCMod1,msguser,appNoticeColor); } break; } case '/dspmsg': { if (msgismod || msgisbc) { let dspmsgnum = parseInt(messagearray[1]); if (!messagearray[1]) { cb.sendNotice(botName + ' The first parameter must be the message number of the notifier you want to display, for example "/dspmsg 13!".',msguser,appNoticeColor) } else if (isNaN(dspmsgnum)) { cb.sendNotice(botName + ' The first parameter must be the numeric value for the message number of the notifier you want to display, for example "/dspmsg 13". ',msguser,appNoticeColor) } else if (dspmsgnum < 1 || dspmsgnum > 20) { cb.sendNotice(botName + ' The first parameter must be a number from 1 to 20 to indicate the message number of the notifier you want to display, for example "/dspmsg 13". ',msguser,appNoticeColor) } else { let dspmsgindex = dspmsgnum - 1; if (messagearray[2]) { if (messagearray[2].toLowerCase() == 'all') { if (!notifierArray[dspmsgindex]) { cb.sendNotice('Notifier ' + dspmsgnum + ' Message is blank.', msguser, appNoticeColor); } else { displayOneNotifier(dspmsgindex); } } else { if (!notifierArray[dspmsgindex]) { cb.sendNotice('Notifier ' + dspmsgnum + ' Message is blank.', msguser, appNoticeColor); } else { cb.sendNotice('Notifier ' + dspmsgnum + ': ' + notifierArray[dspmsgindex], msguser, appNoticeColor); } } } else { if (!notifierArray[dspmsgindex]) { cb.sendNotice('Notifier ' + dspmsgnum + ' Message is blank.', msguser, appNoticeColor); } else { cb.sendNotice('Notifier ' + dspmsgnum + ': ' + notifierArray[dspmsgindex], msguser, appNoticeColor); } } } } else { cb.sendNotice(noticeOnlyBCMod1, msguser, appNoticeColor); } break; } case '/dspallmsg': { if (msgismod || msgisbc) { let displaymessage = ''; for (let msgindex = 0; msgindex < 20; msgindex++) { if (!notifierArray[msgindex]) { displaymessage += 'Notifier ' + (msgindex+1) + ': Message is blank.\n'; } else { displaymessage += 'Notifier ' + (msgindex+1) + ': ' + notifierArray[msgindex] + '\n'; } } cb.sendNotice(displaymessage, msguser, appNoticeColor); } else { cb.sendNotice(noticeOnlyBCMod1,msguser,appNoticeColor); } break; } //********* Room Rules Commands case '/rules': { if (msgismod || msgisbc) { if (messagearray[1]) { if (messagearray[1].toLowerCase() == 'on' || messagearray[1].toLowerCase() == 'off') { roomRulesSetToggle(messagearray[1],msguser,true); } else { cb.sendNotice(botName + ' You entered an invalid parameter for the /rules command, valid options are "on" or "off".', msguser, appNoticeColor); } } else { cb.sendNotice(botName + ' You did not enter a parameter for the /rules command, valid parameters are "on" or "off".', msguser, appNoticeColor); } } else { cb.sendNotice(noticeOnlyBCMod1,msguser,appNoticeColor); } break; } case '/ruleslist': { let rulesendto = msguser; if (msgismod || msgisbc) { rulesendto = ''; } if (roomRulesArray.length > 0) { roomRulesDisplay(rulesendto,'cmd'); } else { cb.sendNotice(botName + ' There are no Room Rules defined.', msguser, appNoticeColor); } break; } //********* Media List commands case '/media': { if (msgismod || msgisbc) { if (messagearray[1] != 'on' && messagearray[1] != 'off') { cb.sendNotice(botName + ' ' + messagearray[1] + ' is not a valid parameter option for /media, the parameter should be "on" or "off" (no quotes).', msguser, appNoticeColor); } else { mediaSetToggle(messagearray[1],msguser,true) } } else { cb.sendNotice(noticeOnlyBCMod1, msguser, appNoticeColor); } break; } case '/medialist': { let mediasendto = msguser; if (msgismod || msgisbc) { mediasendto = ''; } if (mediaListArray.name.length > 0) { mediaDisplay(mediasendto,'cmd'); } else { cb.sendNotice(botName + ' There are no Media List entries defined.', msguser, appNoticeColor); } break; } //********* Help Menu case '/nfhelp': { if (msgismod || msgisbc) { let helptxtmsg = '\u23E9 Dorothy\'s Notices & Room Rules Help Menu for Broadcasters and Moderators'; helptxtmsg += '\n \u2705 NOTIFIER COMMANDS:'; helptxtmsg += '\n \u2022 ' + wordWrap('/notifier [on/off]: enable or disable the display of the rotating notifiers.'); helptxtmsg += '\n \u2022 ' + wordWrap('/chgmsg [msg ID] [new msg]: Update the notifier message with [msg ID] of 1-20 to a new value of [new msg]'); helptxtmsg += '\n \u2022 ' + wordWrap('/dspmsg [msg ID] [all]: display the notifier message with [msg ID] of 1-20. If the "all" parameter is specified after the msg ID, the requested message is sent to the general chat and formatted like a standard Chat Notifier message. If "all" is not specified, it is only sent to the requester, and formatted as a bot notice.'); helptxtmsg += '\n \u2022 ' + wordWrap('/dspallmsg: Display the current value for all of the messages in notifiers 1-20 to the requesting user. This is commonly used to check the messages and see what is currently configured so you can use the message ID in the above commands.'); helptxtmsg += '\n \u2705 ROOM RULES COMMANDS:'; helptxtmsg += '\n \u2022 ' + wordWrap('/ruleslist: Display the Rules List in the chat. Available to any user, only shown to the user that requests it.'); helptxtmsg += '\n \u2022 ' + wordWrap('/rules [on/off]: This command is usable by moderators and broadcasters to toggle "on" or "off" the display of the Room Rules, both as an entry message and as a recurring notice.'); helptxtmsg += '\n \u2705 MEDIA LIST COMMANDS:'; helptxtmsg += '\n \u2022 ' + wordWrap('/medialist: Display the media list in chat. Available to any user, only shown to the user that requests it.'); helptxtmsg += '\n \u2022 ' + wordWrap('/media [on/off]: Toggle the setting for whether the Media List is "on" or "off", and displays at the defined interval. Overrides the initial setting to turn the Media Menu on or off during the show.'); helptxtmsg += '\n \u2705 OTHER COMMANDS:'; helptxtmsg += '\n \u2022 ' + wordWrap('/settings [group]: Send a list of the bot settings defined when the current bot session was started to the current user... mainly for troubleshooting.'); helptxtmsg += '\n \u2022 ' + wordWrap('/setbrdsep [emoji or text]: Updates the separator character used for the border of the recurring notices. You can use emojis, unicode characters, and text values. It is not recommended to change from emoji to text or text to emoji during the show as the spacing has already been defined by the separator type'); helptxtmsg += '\n \u2022 ' + wordWrap('/chgtheme [new theme]: Updates the the theme color that is currently in use for all recurring notices. You can see the full list of available theme IDs by entering the command with no parameter.'); helptxtmsg += '\n \u2022 ' + wordWrap('/chgint [notice type] [new interval]: This command requires two parameters, to define the notice type, and to define the new interval (in minutes), in the format "/chgint [notice type] [new interval]". The [notice type] is one of the values of "notifier", "rules", "media". The [new interval] is the new display interval in minutes. An example of a valid command would be "/chgint rules 7.2" to update the room rules interval to 7.2 minutes.'); helptxtmsg += '\n \u2022 ' + wordWrap('/about: Display a summary of the bot version and highlights of recent additions and fixes.'); cb.sendNotice(helptxtmsg,msguser,appNoticeColor); } else { let helptxtmsg = '\u23E9 Dorothy\'s Notices & Room Rules Help Menu'; helptxtmsg += '\n \u2022 ' + wordWrap('/ruleslist: Display the Rules List in the chat. Available to any user, only shown to the user that requests it.'); helptxtmsg += '\n \u2022 ' + wordWrap('/medialist: Display the Media List in chat. Available to any user, only shown to the user that requests it.'); helptxtmsg += '\n \u2022 ' + wordWrap('/about: Display a summary of the bot version and highlights of recent additions and fixes.'); cb.sendNotice(helptxtmsg,msguser,appNoticeColor); } break; } case '/help': { let helpcmdtext = 'The Dorothy Apps and Bots each have their own help command, please use a specific one:'; helpcmdtext += '\n/nfhelp - Dorothy\'s Notices and Room Rules'; cb.sendNotice(helpcmdtext, msguser, appNoticeColor); break; } //********* Dump config settings case '/settings': { if (msgismod || msgisbc) { if (messagearray[1] == null){messagearray[1] = '';} switch(messagearray[1]) { case '': { cb.sendNotice(botName + ' A parameter is required for settings, such as "/settings notices", please use one of the following: general, notices, leaders, king, chat, responses, notes, icons, vip, extfans, blocked, tipmenu1, tipmenu2, positions, poll, tickets, toys, media, dice or rules.',msguser,appNoticeColor); break; } case 'notices': { cb.sendNotice(botName + ' Dump of all settings for Notices:' + '\n1A. enableEntryMessage : ' + cb.settings.enableEntryMessage + '\n1B. entryMessage : ' + cb.settings.entryMessage + '\n1C. notifierEnable : ' + cb.settings.notifierEnable + '\n1D. notifierInterval : ' + cb.settings.notifierInterval + '\n1E. notifierBorder : ' + cb.settings.notifierBorder + '\n1F1. notifierMessage1 : ' + cb.settings.notifierMessage1 + '\n1F2. notifierMessage2 : ' + cb.settings.notifierMessage2 + '\n1F3. notifierMessage3 : ' + cb.settings.notifierMessage3 + '\n1F4. notifierMessage4 : ' + cb.settings.notifierMessage4 + '\n1F5. notifierMessage5 : ' + cb.settings.notifierMessage5 + '\n1F6. notifierMessage6 : ' + cb.settings.notifierMessage6 + '\n1F7. notifierMessage7 : ' + cb.settings.notifierMessage7 + '\n1F8. notifierMessage8 : ' + cb.settings.notifierMessage8 + '\n1F9. notifierMessage9 : ' + cb.settings.notifierMessage9 + '\n1F10. notifierMessage10 : ' + cb.settings.notifierMessage10 + '\n1F11. notifierMessage11 : ' + cb.settings.notifierMessage11 + '\n1F12. notifierMessage12 : ' + cb.settings.notifierMessage12 + '\n1F13. notifierMessage13 : ' + cb.settings.notifierMessage13 + '\n1F14. notifierMessage14 : ' + cb.settings.notifierMessage14 + '\n1F15. notifierMessage15 : ' + cb.settings.notifierMessage15 + '\n1F16. notifierMessage16 : ' + cb.settings.notifierMessage16 + '\n1F17. notifierMessage17 : ' + cb.settings.notifierMessage17 + '\n1F18. notifierMessage18 : ' + cb.settings.notifierMessage18 + '\n1F19. notifierMessage19 : ' + cb.settings.notifierMessage19 + '\n1F20. notifierMessage20 : ' + cb.settings.notifierMessage20 + '\n1G1. notifierTextColor : ' + cb.settings.notifierTextColor + '\n1G2. notifierTextCustColor : ' + cb.settings.notifierTextCustColor + '\n1G3. notifierBgColor : ' + cb.settings.notifierBgColor + '\n1G4. notifierBgCustColor : ' + cb.settings.notifierBgCustColor ,msguser); break; } case 'rules': { cb.sendNotice(botName + ' Dump of all current settings for the dice game:' + '\n2A. roomRulesEnable : ' + cb.settings.roomRulesEnable + '\n2B. roomRulesInterval : ' + cb.settings.roomRulesInterval + '\n2C1. roomRule1 : ' + cb.settings.roomRule1 + '\n2C2. roomRule2 : ' + cb.settings.roomRule2 + '\n2C3. roomRule3 : ' + cb.settings.roomRule3 + '\n2C4. roomRule4 : ' + cb.settings.roomRule4 + '\n2C5. roomRule5 : ' + cb.settings.roomRule5 + '\n2C6. roomRule6 : ' + cb.settings.roomRule6 + '\n2C7. roomRule7 : ' + cb.settings.roomRule7 + '\n2C8. roomRule8 : ' + cb.settings.roomRule8 + '\n2C9. roomRule9 : ' + cb.settings.roomRule9 + '\n2C10. roomRule10 : ' + cb.settings.roomRule10 + '\n2D1. roomRulesTextColor : ' + cb.settings.roomRulesTextColor + '\n2D2. roomRulesTextCustColor : ' + cb.settings.roomRulesTextCustColor + '\n2D3. roomRulesBgColor : ' + cb.settings.roomRulesBgColor + '\n2D3. roomRulesBgCustColor : ' + cb.settings.roomRulesBgCustColor ,msguser); break; } case 'media': { cb.sendNotice(botName + ' Dump of all current settings for the media list:' + '\n******************* Media List *************************' + '\n3A. mediaListEnable : ' + cb.settings.mediaListEnable + '\n3B. mediaListInterval : ' + cb.settings.mediaListInterval + '\n3C. mediaListIntro : ' + cb.settings.mediaListIntro + '\n3D. mediaListSameLine : ' + cb.settings.mediaListSameLine + '\n3E1. mediaListText1 : ' + cb.settings.mediaListText1 + '\n3E2. mediaListItem1 : ' + cb.settings.mediaListItem1 + '\n3E3. mediaListText2 : ' + cb.settings.mediaListText2 + '\n3E4. mediaListItem2 : ' + cb.settings.mediaListItem2 + '\n3E5. mediaListText3 : ' + cb.settings.mediaListText3 + '\n3E6. mediaListItem3 : ' + cb.settings.mediaListItem3 + '\n3E7. mediaListText4 : ' + cb.settings.mediaListText4 + '\n3E8. mediaListItem4 : ' + cb.settings.mediaListItem4 + '\n3E9. mediaListText5 : ' + cb.settings.mediaListText5 + '\n3E10. mediaListItem5 : ' + cb.settings.mediaListItem5 + '\n3E11. mediaListText6 : ' + cb.settings.mediaListText6 + '\n3E12. mediaListItem6 : ' + cb.settings.mediaListItem6 + '\n3E13. mediaListText7 : ' + cb.settings.mediaListText7 + '\n3E14. mediaListItem7 : ' + cb.settings.mediaListItem7 + '\n3E15. mediaListText8 : ' + cb.settings.mediaListText8 + '\n3E16. mediaListItem8 : ' + cb.settings.mediaListItem8 + '\n3E17. mediaListText9 : ' + cb.settings.mediaListText9 + '\n3E18. mediaListItem9 : ' + cb.settings.mediaListItem9 + '\n3E19. mediaListText10 : ' + cb.settings.mediaListText10 + '\n3E20. mediaListItem10 : ' + cb.settings.mediaListItem10 + '\n3E21. mediaListText11 : ' + cb.settings.mediaListText11 + '\n3E22. mediaListItem11 : ' + cb.settings.mediaListItem11 + '\n3E23. mediaListText12 : ' + cb.settings.mediaListText12 + '\n3E24. mediaListItem12 : ' + cb.settings.mediaListItem12 + '\n3F1. mediaListTextColor : ' + cb.settings.mediaListTextColor + '\n3F2. mediaListCustTextColor : ' + cb.settings.mediaListCustTextColor + '\n3F3. mediaListBgColor : ' + cb.settings.mediaListBgColor + '\n3F4. mediaListCustBgColor : ' + cb.settings.mediaListCustBgColor ,msguser); break; } case 'general': { cb.sendNotice(botName + ' Dump of all launch and current settings for General Settings and Personalization:' + '\n4A. colorTheme : ' + cb.settings.colorTheme + '\n4B1. colorThemeCustBg1 : ' + cb.settings.colorThemeCustBg1 + '\n4B2. colorThemeCustBg2 : ' + cb.settings.colorThemeCustBg2 + '\n4B3. colorThemeCustBg2 : ' + cb.settings.colorThemeCustBg3 + '\n4B4. colorThemeCustText : ' + cb.settings.colorThemeCustText + '\n4C. colorsGradientDirection : ' + cb.settings.colorsGradientDirection + '\n4D1. noticeSepStyle : ' + cb.settings.noticeSepStyle + '\n4D2. borderChar : initial : ' + cb.settings.borderChar + ' : current : ' + borderChar ,msguser); break; } default: { cb.sendNotice(botName + ' Invalid setting group, please use one of the following: notices, leaders, king, chat, responses, notes, icons, vip, extfans, blocked, tipmenu1, tipmenu2, positions, poll, tickets, toys, media, dice or rules.',msguser,appNoticeColor); break; } } } else { cb.sendNotice(noticeOnlyBCMod1,msguser,appNoticeColor); } } } } return msg; }); // *********************************** Actions on user entering ************************************** cb.onEnter(function(user) { // Variables let enteruser = user.user; let enterisbc = (enteruser == BC); let enterisgray = true; if (user.has_tokens) { enterisgray = false; } // **** General Entry Message if (cb.settings.enableEntryMessage == 'Yes' && !enterisgray) { let entryMessage = borderWelcomeTop; entryMessage += '\n' + checkUsername(checkNextLine(cb.settings.entryMessage),enteruser); if (cb.settings.noticeSepStyle != 'No Border') { entryMessage += '\n' + borderWelcomeBottom; } cb.sendNotice(entryMessage, enteruser, noticeBgColor, noticeTextColor, 'bold'); } // **** Room Rules if (roomRuleToggle && !enterisbc) { if (roomRulesArray.length > 0) { roomRulesDisplay(enteruser,'enter'); } } }); // *********************************** Actions upon leaving ************************************** cb.onLeave(function(user) { let userLeave = user.user; }); // ******************************* Actions upon following ************************************** cb.onFollow(function(user) { let followUser = user.user; }); // *********************************** Actions upon tipping ************************************** cb.onTip(function (tip) { let tipUser = tip.from_user; });
© Copyright Chaturbate 2011- 2024. All Rights Reserved.