本文整理汇总了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;
}
示例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);
}
示例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");
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例15: getSource
import com.linecorp.bot.model.event.source.Source; //导入依赖的package包/类
/**
* Get event source
*/
Source getSource();