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


Java Message.isReply方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramBotsExample,代码行数:8,代码来源:WeatherHandlers.java

示例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);
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramBotsExample,代码行数:8,代码来源:WeatherHandlers.java

示例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);
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramBotsExample,代码行数:8,代码来源:WeatherHandlers.java

示例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);
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramBotsExample,代码行数:8,代码来源:WeatherHandlers.java

示例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);
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:rubenlagus,项目名称:TelegramBotsExample,代码行数:44,代码来源:DirectionsHandlers.java


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