@@ -24,37 +24,58 @@ module.exports = {
2424 //≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
2525
2626 subtitle ( data , presets ) {
27- let defaultText = "" ;
28- if ( data . message ) {
29- defaultText = `"${ data . message . replace ( / [ \n \r ] + / , " ↲ " ) } "` ;
30- } else if ( data . embeds ?. length > 0 ) {
31- defaultText = `${ data . embeds . length } Embeds` ;
32- } else if ( data . attachments ?. length > 0 ) {
33- defaultText = `${ data . attachments . length } Attachments` ;
34- } else if ( data . buttons ?. length > 0 || data . selectMenus ?. length > 0 ) {
35- defaultText = `${ data . buttons . length } Buttons and ${ data . selectMenus . length } Select Menus` ;
36- } else if ( data . editMessage && data . editMessage !== "0" ) {
37- defaultText = `Message Options - ${ presets . getVariableText (
38- data . editMessage ,
39- data . editMessageVarName
40- ) } `;
41- } else {
42- defaultText = `Nothing (might cause error)` ;
27+ if ( data . actionDescription ) {
28+ return `<span style="color: ${
29+ data . actionDescriptionColor || "#ffffff"
30+ } ;">${ data . actionDescription } </span>`;
4331 }
44- if ( data . dontReply ) {
45- defaultText = `Store Data: ${ defaultText } ` ;
46- } else {
47- defaultText = `${ presets . getSendReplyTargetText (
48- data . channel ,
49- data . varName
50- ) } : ${ defaultText } `;
32+ let targetText = presets . getSendReplyTargetText ( data . channel , data . varName ) ;
33+ if ( data . dontSend ) {
34+ targetText = `Don't Send` ;
35+ } else if ( data . editMessage !== "0" ) {
36+ switch ( data . editMessage ) {
37+ case "intUpdate" :
38+ targetText = "Interaction Update" ;
39+ break ;
40+ case "deferUpdate" :
41+ targetText = "Defer Update" ;
42+ break ;
43+ case "replyUpdate" :
44+ targetText = "Reply Update" ;
45+ break ;
46+ default :
47+ targetText = `Edit ${ presets . getVariableText (
48+ data . editMessage ,
49+ data . editMessageVarName
50+ ) } `;
51+ }
5152 }
52- const userDesc = data . actionDescription ?. toString ( ) . trim ( ) ;
53- if ( userDesc ) {
54- const color = data . actionDescriptionColor || "#ffffff" ;
55- return `<span style="color: ${ color } ;">${ userDesc } </span>` ;
53+ let messageText ;
54+ if ( data . message ) messageText = data . message ;
55+ else if ( ! data . message ) {
56+ if ( data . embeds . length ) {
57+ messageText = `${ data . embeds . length } ${
58+ data . embeds . length === 1 ? "Embed" : "Embeds"
59+ } `;
60+ } else if ( data . pollAnswers . length ) {
61+ messageText = `Poll: ${ data . pollQuestion } ` ;
62+ } else if ( data . buttons . length ) {
63+ messageText = `${ data . buttons . length } ${
64+ data . buttons . length === 1 ? "Button" : "Buttons"
65+ } `;
66+ } else if ( data . selectMenus . length ) {
67+ messageText = `${ data . selectMenus . length } ${
68+ data . selectMenus . length === 1 ? "Select Menu" : "Select Menus"
69+ } `;
70+ } else if ( data . attachments . length ) {
71+ messageText = `${ data . attachments . length } ${
72+ data . attachments . length === 1 ? "Attachment" : "Attachments"
73+ } `;
74+ } else {
75+ messageText = "Nothing (might cause error)" ;
76+ }
5677 }
57- return defaultText ;
78+ return ` ${ targetText } - ${ messageText } ` ;
5879 } ,
5980
6081 //≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
@@ -703,24 +724,20 @@ module.exports = {
703724 <dbm-checkbox id="suppressNotifications" label="Suppress Notifications"></dbm-checkbox>
704725 </div>
705726
706- <br>
707- <hr class="subtlebar" style="margin-top: 4px; margin-bottom: 4px; width: 100%;">
708-
709- <table style="width:100%;">
710- <tr>
711- <td>
712- <span class="dbminputlabel">Action Description</span><br>
713- <input type="text" class="round" id="actionDescription" placeholder="Leave blank for default...">
714- </td>
715- <td style="padding:0px 0px 0px 10px; width:55px;">
716- <div style="float:left; padding:0px 0px 0px 7px; margin-top:-5px"></div><br>
717- <input type="color" value="#ffffff" class="round" id="actionDescriptionColor">
718- </td>
719- </tr>
720- </table>
721-
722- <hr class="subtlebar" style="margin-top: 4px; margin-bottom: 4px; width: 100%;">
723- <br>
727+ <br>
728+ <hr class="subtlebar">
729+ <br>
730+ <div style="float: left; width: 79%;">
731+ <span class="dbminputlabel">Action Description</span>
732+ <input type="text" class="round" id="actionDescription" placeholder="Leave blank for default...">
733+ </div>
734+ <div style="float: right; width: 19%;">
735+ <span class="dbminputlabel">Color</span>
736+ <input type="color" value="#ffffff" class="round" id="actionDescriptionColor">
737+ </div>
738+ <br><br><br>
739+ <hr class="subtlebar">
740+ <br>
724741
725742 <div style="padding-bottom: 12px;">
726743 <retrieve-from-variable allowNone dropdownLabel="Message/Options to Edit" selectId="editMessage" variableInputId="editMessageVarName" variableContainerId="editMessageVarNameContainer">
0 commit comments