How to use the viber-bot.Message.Picture function in viber-bot

To help you get started, we’ve selected a few viber-bot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github broidHQ / integrations / integrations / broid-viber / src / core / adapter.ts View on Github external
Text: attachment.name || attachment.content,
              };
            }, attachmentsButtons),
            DefaultHeight: true,
            Type: "keyboard",
          };
        }

        if (type === "Note") {
          return [new Message.Text(content, keyboard), message];
        } else if (type === "Image" || type === "Video") {
          const url = R.path(["object", "url"], message);
          const preview = R.path(["object", "preview"], message);

          if (type === "Image") {
            return [new Message.Picture(url, content, preview, keyboard), message];
          } else {
            return [new Message.Video(url, null, preview, null, keyboard), message];
          }
        } else if (type === "Place") {
          const latitude = R.path(["object", "latitude"], message);
          const longitude = R.path(["object", "longitude"], message);
          return [new Message.Location(latitude, longitude, keyboard), message];
        }

        return [null, message];
      })
      .spread((messageBuilder: any, message: any) => {
github broidHQ / integrations / broid-viber / src / core / Adapter.ts View on Github external
};
              },
              attachmentsButtons),
            DefaultHeight: true,
            Type: 'keyboard',
          };
        }

        if (dataType === 'Note') {
          return [new Message.Text(content, keyboard), message];
        } else if (dataType === 'Image' || dataType === 'Video') {
          const url = R.path(['object', 'url'], message);
          const preview = R.path(['object', 'preview'], message);

          if (dataType === 'Image') {
            return [new Message.Picture(url, content, preview, keyboard), message];
          } else {
            return [new Message.Video(url, null, preview, null, keyboard), message];
          }
        } else if (dataType === 'Place') {
          const latitude = R.path(['object', 'latitude'], message);
          const longitude = R.path(['object', 'longitude'], message);
          return [new Message.Location(latitude, longitude, keyboard), message];
        }

        return [null, message];
      })
      .spread((messageBuilder: any, message: any) => {
github broidHQ / integrations / broid-viber / src / core / adapter.ts View on Github external
Text: attachment.name || attachment.content,
              };
            }, attachmentsButtons),
            DefaultHeight: true,
            Type: "keyboard",
          };
        }

        if (type === "Note") {
          return [new Message.Text(content, keyboard), message];
        } else if (type === "Image" || type === "Video") {
          const url = R.path(["object", "url"], message);
          const preview = R.path(["object", "preview"], message);

          if (type === "Image") {
            return [new Message.Picture(url, content, preview, keyboard), message];
          } else {
            return [new Message.Video(url, null, preview, null, keyboard), message];
          }
        } else if (type === "Place") {
          const latitude = R.path(["object", "latitude"], message);
          const longitude = R.path(["object", "longitude"], message);
          return [new Message.Location(latitude, longitude, keyboard), message];
        }

        return [null, message];
      })
      .spread((messageBuilder: any, message: any) => {