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


Java Source类代码示例

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


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

示例1: randomName

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
public String randomName(Event event, Source source, String group_id){
    List<GroupMember> groupMemberList = new ArrayList<>();
    groupMemberList = MainDao.getAllMemberIds(group_id);
    int banyakMember=groupMemberList.size();
    int randInt = (int) (Math.random() * ((banyakMember-1)-0));

    String senderId = event.getSource().getSenderId();
    String type  = getter.getType(source);
    GroupMember user_id_beruntung = groupMemberList.get(randInt);

    String user_name_beruntung = getter.getGroupMemberName(type, senderId, user_id_beruntung.getUserId());

    System.out.println("ID BERUNTUNG : " + user_id_beruntung);
    System.out.println("USERNAME BERUNTUNG " + user_name_beruntung);
    return user_name_beruntung;
}
 
开发者ID:axellageraldinc,项目名称:lj-line-bot,代码行数:17,代码来源:RandomUsernameFromGroup.java

示例2: handleJoinNewGroup

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@EventMapping
public void handleJoinNewGroup(JoinEvent joinEvent) {
    List<Message> messageList = new ArrayList<>();
    Source source = joinEvent.getSource();
    StickerMessage stickerMessage = new StickerMessage("1", "2");
    messageList.add(stickerMessage);
    TextMessage textMessage = new TextMessage("Nuwun yo aku wes entuk join grup iki\n" +
            "Silakan ketik /fitur untuk melihat fitur-fitur yang ada.");
    messageList.add(textMessage);
    KirimPesan(joinEvent.getReplyToken(), messageList);
}
 
开发者ID:axellageraldinc,项目名称:lj-line-bot,代码行数:12,代码来源:MainController.java

示例3: handleLeave

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@EventMapping
public void handleLeave(LeaveEvent leaveEvent){
    Source source = leaveEvent.getSource();
    String groupId = getter.getId(source);
    MainDao.DropTable(groupId);
    MainDao.DropTable(groupId + "_memberIds");
}
 
开发者ID:axellageraldinc,项目名称:lj-line-bot,代码行数:8,代码来源:MainController.java

示例4: handleNewFollower

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@EventMapping
public void handleNewFollower(FollowEvent followEvent){
    List<Message> messageList = new ArrayList<>();
    Source source = followEvent.getSource();
    String id_umum = getter.getId(source);
    MainDao.CreateTableData(id_umum);
    StickerMessage stickerMessage = new StickerMessage("1", "2");
    messageList.add(stickerMessage);
    TextMessage textMessage = new TextMessage("Nuwun yo aku wes di-add dadi friend\n" +
            "Silakan ketik /fitur untuk melihat fitur-fitur yang ada.\n" +
            "Aku di invite ning group yo iso lhoooo");
    messageList.add(textMessage);
    KirimPesan(followEvent.getReplyToken(), messageList);
}
 
开发者ID:axellageraldinc,项目名称:lj-line-bot,代码行数:15,代码来源:MainController.java

示例5: getId

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
public String getId(Source source){
    String id=null;
    String type=null;
    if (source instanceof GroupSource) {
        id = ((GroupSource) source).getGroupId();
        type="group";
    } else if (source instanceof RoomSource) {
        id = ((RoomSource) source).getRoomId();
        type="room";
    } else{
        id = source.getUserId();
        type="personal";
    }
    return id;
}
 
开发者ID:axellageraldinc,项目名称:lj-line-bot,代码行数:16,代码来源:Getter.java

示例6: getType

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
public String getType(Source source){
    String type = null;
    if (source instanceof GroupSource)
        type="group";
    else if(source instanceof RoomSource)
        type="room";
    else
        type="personal";
    return type;
}
 
开发者ID:axellageraldinc,项目名称:lj-line-bot,代码行数:11,代码来源:Getter.java

示例7: JoinEvent

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@JsonCreator
public JoinEvent(
        @JsonProperty("replyToken") String replyToken,
        @JsonProperty("source") Source source,
        @JsonProperty("timestamp") Instant timestamp) {
    this.replyToken = replyToken;
    this.source = source;
    this.timestamp = timestamp;
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:10,代码来源:JoinEvent.java

示例8: UnfollowEvent

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@JsonCreator
public UnfollowEvent(
        @JsonProperty("source") Source source,
        @JsonProperty("timestamp") Instant timestamp) {
    this.source = source;
    this.timestamp = timestamp;
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:8,代码来源:UnfollowEvent.java

示例9: MessageEvent

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@JsonCreator
public MessageEvent(
        @JsonProperty("replyToken") String replyToken,
        @JsonProperty("source") Source source,
        @JsonProperty("message") T message,
        @JsonProperty("timestamp") Instant timestamp) {
    this.replyToken = replyToken;
    this.source = source;
    this.message = message;
    this.timestamp = timestamp;
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:12,代码来源:MessageEvent.java

示例10: FollowEvent

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@JsonCreator
public FollowEvent(
        @JsonProperty("replyToken") String replyToken,
        @JsonProperty("source") Source source,
        @JsonProperty("timestamp") Instant timestamp) {
    this.replyToken = replyToken;
    this.source = source;
    this.timestamp = timestamp;
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:10,代码来源:FollowEvent.java

示例11: LeaveEvent

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@JsonCreator
public LeaveEvent(
        @JsonProperty("source") Source source,
        @JsonProperty("timestamp") Instant timestamp) {
    this.source = source;
    this.timestamp = timestamp;
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:8,代码来源:LeaveEvent.java

示例12: UnknownEvent

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
public UnknownEvent(
        @JsonProperty("type") String type,
        @JsonProperty("source") Source source,
        @JsonProperty("timestamp") Instant timestamp
) {
    this.type = type;
    this.source = source;
    this.timestamp = timestamp;
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:10,代码来源:UnknownEvent.java

示例13: BeaconEvent

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@JsonCreator
public BeaconEvent(
        @JsonProperty("replyToken") String replyToken,
        @JsonProperty("source") Source source,
        @JsonProperty("timestamp") Instant timestamp,
        @JsonProperty("beacon") BeaconContent beacon
) {
    this.replyToken = replyToken;
    this.source = source;
    this.timestamp = timestamp;
    this.beacon = beacon;
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:13,代码来源:BeaconEvent.java

示例14: PostbackEvent

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
@JsonCreator
public PostbackEvent(
        @JsonProperty("replyToken") String replyToken,
        @JsonProperty("source") Source source,
        @JsonProperty("postback") PostbackContent postbackContent,
        @JsonProperty("timestamp") Instant timestamp) {
    this.replyToken = replyToken;
    this.source = source;
    this.postbackContent = postbackContent;
    this.timestamp = timestamp;
}
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:12,代码来源:PostbackEvent.java

示例15: getSource

import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
/**
 * Get event source
 */
Source getSource();
 
开发者ID:line,项目名称:line-bot-sdk-java,代码行数:5,代码来源:Event.java


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