当前位置: 首页>>代码示例>>Java>>正文


Java Recipient类代码示例

本文整理汇总了Java中com.github.messenger4j.send.Recipient的典型用法代码示例。如果您正苦于以下问题:Java Recipient类的具体用法?Java Recipient怎么用?Java Recipient使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Recipient类属于com.github.messenger4j.send包,在下文中一共展示了Recipient类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendTextMessage

import com.github.messenger4j.send.Recipient; //导入依赖的package包/类
private void sendTextMessage(String recipientId, String text) {
    try {
        final Recipient recipient = Recipient.newBuilder().recipientId(recipientId).build();
        final NotificationType notificationType = NotificationType.REGULAR;
        sendClient.sendTextMessage(recipient, notificationType, text);
    } catch (MessengerApiException | MessengerIOException e) {
        handleSendException(e);
    }
}
 
开发者ID:dbpedia,项目名称:chatbot,代码行数:10,代码来源:ResponseHandler.java

示例2: sendTextMessage

import com.github.messenger4j.send.Recipient; //导入依赖的package包/类
private void sendTextMessage(String recipientId, String text) {
    text = text.substring(0, Math.min(text.length(), 300));
    try {
        final Recipient recipient = Recipient.newBuilder().recipientId(recipientId).build();
        final NotificationType notificationType = NotificationType.REGULAR;
        final String metadata = "DEVELOPER_DEFINED_METADATA";

        this.sendClient.sendTextMessage(recipient, notificationType, text, metadata);
    } catch (MessengerApiException | MessengerIOException e) {
        handleSendException(e);
    }
}
 
开发者ID:ikhamlic,项目名称:esct-messenger-bot,代码行数:13,代码来源:MessengerPlatformCallbackHandler.java

示例3: sendTextMessage

import com.github.messenger4j.send.Recipient; //导入依赖的package包/类
private void sendTextMessage(String recipientId, String text) {
    try {
        final Recipient recipient = Recipient.newBuilder().recipientId(recipientId).build();
        final NotificationType notificationType = NotificationType.REGULAR;
        final String metadata = "DEVELOPER_DEFINED_METADATA";

        this.sendClient.sendTextMessage(recipient, notificationType, text, metadata);
    } catch (MessengerApiException | MessengerIOException e) {
        handleSendException(e);
    }
}
 
开发者ID:messenger4j,项目名称:messenger4j-spring-boot-quickstart-template,代码行数:12,代码来源:MessengerPlatformCallbackHandler.java


注:本文中的com.github.messenger4j.send.Recipient类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。