@@ -17,86 +17,86 @@ private ListenerCodeSuggestion() {
1717 "\n " +
1818 "app.step(step);\n " ;
1919
20- public static String viewSubmission (String callbackId ) {
20+ public static final String viewSubmission (String callbackId ) {
2121 return COMMON_PREFIX +
2222 "app.viewSubmission(\" " + callbackId + "\" , (req, ctx) -> {\n " +
2323 " // Sent inputs: req.getPayload().getView().getState().getValues()\n " +
2424 " return ctx.ack();\n " +
2525 "});\n " ;
2626 }
2727
28- public static String viewClosed (String callbackId ) {
28+ public static final String viewClosed (String callbackId ) {
2929 return COMMON_PREFIX +
3030 "app.viewClosed(\" " + callbackId + "\" , (req, ctx) -> {\n " +
3131 " // Do something where\n " +
3232 " return ctx.ack();\n " +
3333 "});\n " ;
3434 }
3535
36- public static String dialogSubmission (String callbackId ) {
36+ public static final String dialogSubmission (String callbackId ) {
3737 return COMMON_PREFIX +
3838 "app.dialogSubmission(\" " + callbackId + "\" , (req, ctx) -> {\n " +
3939 " // Do something where\n " +
4040 " return ctx.ack();\n " +
4141 "});\n " ;
4242 }
4343
44- public static String dialogSuggestion (String callbackId ) {
44+ public static final String dialogSuggestion (String callbackId ) {
4545 return COMMON_PREFIX +
4646 "app.dialogSubmission(\" " + callbackId + "\" , (req, ctx) -> {\n " +
4747 " List<Option> options = Arrays.asList(Option.builder().label(\" label\" ).value(\" value\" ).build());\n " +
4848 " return ctx.ack(r -> r.options(options));\n " +
4949 "});\n " ;
5050 }
5151
52- public static String dialogCancellation (String callbackId ) {
52+ public static final String dialogCancellation (String callbackId ) {
5353 return COMMON_PREFIX +
5454 "app.dialogCancellation(\" " + callbackId + "\" , (req, ctx) -> {\n " +
5555 " // Do something where\n " +
5656 " return ctx.ack();\n " +
5757 "});\n " ;
5858 }
5959
60- public static String command (String command ) {
60+ public static final String command (String command ) {
6161 return COMMON_PREFIX +
6262 "app.command(\" " + command + "\" , (req, ctx) -> {\n " +
6363 " return ctx.ack();\n " +
6464 "});\n " ;
6565 }
6666
67- public static String attachmentAction (String callbackId ) {
67+ public static final String attachmentAction (String callbackId ) {
6868 return COMMON_PREFIX +
6969 "app.attachmentAction(\" " + callbackId + "\" , (req, ctx) -> {\n " +
7070 " // Do something where\n " +
7171 " return ctx.ack();\n " +
7272 "});\n " ;
7373 }
7474
75- public static String blockAction (String actionId ) {
75+ public static final String blockAction (String actionId ) {
7676 return COMMON_PREFIX +
7777 "app.blockAction(\" " + actionId + "\" , (req, ctx) -> {\n " +
7878 " // Do something where\n " +
7979 " return ctx.ack();\n " +
8080 "});\n " ;
8181 }
8282
83- public static String blockSuggestion (String actionId ) {
83+ public static final String blockSuggestion (String actionId ) {
8484 return COMMON_PREFIX +
8585 "app.blockSuggestion(\" " + actionId + "\" , (req, ctx) -> {\n " +
8686 " List<Option> options = Arrays.asList(Option.builder().text(plainText(\" label\" )).value(\" v\" ).build());\n " +
8787 " return ctx.ack(r -> r.options(options));\n " +
8888 "});\n " ;
8989 }
9090
91- public static String event (String eventTypeAndSubtype ) {
91+ public static final String event (String eventTypeAndSubtype ) {
9292 String className = toEventClassName (eventTypeAndSubtype );
9393 return COMMON_PREFIX +
9494 "app.event(" + className + ".class, (payload, ctx) -> {\n " +
9595 " return ctx.ack();\n " +
9696 "});\n " ;
9797 }
9898
99- public static String toEventClassName (String eventTypeAndSubtype ) {
99+ public static final String toEventClassName (String eventTypeAndSubtype ) {
100100 String eventType = eventTypeAndSubtype ;
101101 String [] elements = eventTypeAndSubtype .split (":" );
102102 if (elements .length == 2 ) {
@@ -105,6 +105,9 @@ public static String toEventClassName(String eventTypeAndSubtype) {
105105 .replaceFirst ("_message" , "" )
106106 .replaceFirst ("message_" , "" );
107107 }
108+ if (eventType == null ) {
109+ return "" ;
110+ }
108111 StringBuilder sb = new StringBuilder ();
109112 char [] cs = eventType .toCharArray ();
110113 for (int i = 0 ; i < cs .length ; i ++) {
@@ -118,18 +121,18 @@ public static String toEventClassName(String eventTypeAndSubtype) {
118121 sb .append (c );
119122 }
120123 }
121- return sb + "Event" ;
124+ return sb . toString () + "Event" ;
122125 }
123126
124- public static String globalShortcut (String callbackId ) {
127+ public static final String globalShortcut (String callbackId ) {
125128 return COMMON_PREFIX +
126129 "app.globalShortcut(\" " + callbackId + "\" , (req, ctx) -> {\n " +
127130 " // Do something where\n " +
128131 " return ctx.ack();\n " +
129132 "});\n " ;
130133 }
131134
132- public static String messageShortcut (String callbackId ) {
135+ public static final String messageShortcut (String callbackId ) {
133136 return COMMON_PREFIX +
134137 "app.messageShortcut(\" " + callbackId + "\" , (req, ctx) -> {\n " +
135138 " // Do something where\n " +
0 commit comments