當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。