@tiledesk/tiledesk-tybot-connector 2.0.8-rc1 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -319,31 +319,55 @@ class TiledeskChatbotUtil {
319
319
  json_buttons.forEach(button => {
320
320
  if (button.value && button.type === "action" && button.action) {
321
321
  button.show_echo = true;
322
+ // console.log("pushing:", button)
322
323
  final_buttons.push(button);
323
324
  }
324
325
  else if (button.value && button.type === "text") {
325
326
  button.show_echo = true;
327
+ // console.log("pushing:", button)
326
328
  final_buttons.push(button);
327
329
  }
328
330
  else if (button.value && button.type === "url" && button.link) {
329
331
  button.show_echo = true;
332
+ // console.log("pushing:", button)
330
333
  final_buttons.push(button);
331
334
  }
332
335
  else {
333
- winston.verbose("Invalid button. Skipping:", button);
336
+ console.log("Invalid button. Skipping:", JSON.stringify(button) );
334
337
  }
335
338
  });
336
339
  }
340
+
341
+ // "buttons": [
342
+ // {
343
+ // "type": "action",
344
+ // "value": "Button1", // obbligatorio sempre
345
+ // "action": "#bb347206-d639-4926-94c9-e94930623dce", // mandatory
346
+ // "show_echo": true, // lo inserisco sempre
347
+ // "alias": "button1 alias"
348
+ // },
349
+ // {
350
+ // "type": "text",
351
+ // "value": "Button2 text", // obbligatorio sempre
352
+ // "show_echo": true // lo inserisco sempre
353
+ // },
354
+ // {
355
+ // "type": "url",
356
+ // "value": "Button3 link", // obbligatorio sempre
357
+ // "link": "http://", // obbligatorio
358
+ // "show_echo": true // lo inserisco sempre
359
+ // }
360
+ // ]
337
361
  }
338
362
  catch(error) {
339
- winston.warn("Invalid json_buttons:", error)
363
+ console.error("Invalid json_buttons:", error)
340
364
  }
341
365
  if (final_buttons && final_buttons.length > 0) {
342
366
  command.message.attributes.attachment.buttons = final_buttons;
343
367
  delete command.message.attributes.attachment.json_buttons;
344
368
  }
345
369
  else {
346
- winston.verbose("Invalid json_buttons. Skipping...")
370
+ console.log("Invalid json_buttons. Skipping")
347
371
  }
348
372
  }
349
373
  }