本文整理汇总了Java中org.telegram.telegrambots.api.objects.Message.isReply方法的典型用法代码示例。如果您正苦于以下问题:Java Message.isReply方法的具体用法?Java Message.isReply怎么用?Java Message.isReply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.telegrambots.api.objects.Message
的用法示例。
在下文中一共展示了Message.isReply方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onForecastNewWeather
import org.telegram.telegrambots.api.objects.Message; //导入方法依赖的package包/类
private static SendMessage onForecastNewWeather(Message message, String language) {
if (message.isReply()) {
return onForecastWeatherReceived(message.getChatId(), message.getFrom().getId(), message.getMessageId(), message.getText(), language);
} else {
return sendMessageDefault(message, language);
}
}
示例2: onForecastWeatherLocation
import org.telegram.telegrambots.api.objects.Message; //导入方法依赖的package包/类
private static SendMessage onForecastWeatherLocation(Message message, String language) {
if (message.isReply() && message.hasLocation()) {
return onForecastWeatherLocationReceived(message, language);
} else {
return sendMessageDefault(message, language);
}
}
示例3: onCurrentNewWeather
import org.telegram.telegrambots.api.objects.Message; //导入方法依赖的package包/类
private static SendMessage onCurrentNewWeather(Message message, String language) {
if (message.isReply()) {
return onCurrentWeatherReceived(message.getChatId(), message.getFrom().getId(), message.getMessageId(), message.getText(), language);
} else {
return sendMessageDefault(message, language);
}
}
示例4: onCurrentWeatherLocation
import org.telegram.telegrambots.api.objects.Message; //导入方法依赖的package包/类
private static SendMessage onCurrentWeatherLocation(Message message, String language) {
if (message.isReply() && message.hasLocation()) {
return onCurrentWeatherLocationReceived(message, language);
} else {
return sendMessageDefault(message, language);
}
}
示例5: handleDirections
import org.telegram.telegrambots.api.objects.Message; //导入方法依赖的package包/类
private void handleDirections(Update update) throws InvalidObjectException {
Message message = update.getMessage();
if (message != null && message.hasText()) {
if (languageMessages.contains(message.getFrom().getId())) {
onLanguageSelected(message);
} else {
String language = DatabaseManager.getInstance().getUserLanguage(update.getMessage().getFrom().getId());
if (message.getText().startsWith(Commands.setLanguageCommand)) {
onSetLanguageCommand(message, language);
} else if (message.getText().startsWith(Commands.startDirectionCommand)) {
onStartdirectionsCommand(message, language);
} else if ((message.getText().startsWith(Commands.help) ||
(message.getText().startsWith(Commands.startCommand) || !message.isGroupMessage())) &&
DatabaseManager.getInstance().getUserDestinationStatus(message.getFrom().getId()) == -1) {
sendHelpMessage(message, language);
} else if (!message.getText().startsWith("/")) {
if (DatabaseManager.getInstance().getUserDestinationStatus(message.getFrom().getId()) == WATING_ORIGIN_STATUS &&
message.isReply() &&
DatabaseManager.getInstance().getUserDestinationMessageId(message.getFrom().getId()) == message.getReplyToMessage().getMessageId()) {
onOriginReceived(message, language);
} else if (DatabaseManager.getInstance().getUserDestinationStatus(message.getFrom().getId()) == WATING_DESTINY_STATUS &&
message.isReply() &&
DatabaseManager.getInstance().getUserDestinationMessageId(message.getFrom().getId()) == message.getReplyToMessage().getMessageId()) {
onDestinationReceived(message, language);
} else if (!message.isReply()) {
if (DatabaseManager.getInstance().getUserDestinationStatus(message.getFrom().getId()) == -1) {
sendHelpMessage(message, language);
} else {
SendMessage sendMessageRequest = new SendMessage();
sendMessageRequest.setText(LocalisationService.getString("youNeedReplyDirections", language));
sendMessageRequest.setChatId(message.getChatId());
try {
sendMessage(sendMessageRequest);
} catch (TelegramApiException e) {
BotLogger.error(LOGTAG, e);
}
}
}
}
}
}
}