• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ParseMode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ParseMode类属于org.telegram.telegrambots.api.methods包,在下文中一共展示了ParseMode类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: run

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public void run(Update update, TelegramLongPollingBot bot) {

		SendMessage sm = new SendMessage();
		sm.setChatId(update.getMessage().getChatId());
		sm.setParseMode(ParseMode.HTML);
		
		String finalMessage = new String("<b>Verificador de Qualis - CAPES</b>\n");
		finalMessage = finalMessage.concat("\nUtilize os seguintes comandos para consulta\n");
		finalMessage = finalMessage.concat("\n<b>/conferencia</b> <i>sigla_conferencia</i> OU <i>nome_conferencia</i>");
		finalMessage = finalMessage.concat("\n<b>/periodico</b> <i>issn_periodico</i> OU <i>nome_periodico</i>");
		
		sm.setText(finalMessage);
		
		try {
			bot.sendMessage(sm);
		} catch (TelegramApiException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
 
开发者ID:InsightLab,项目名称:telegram-bots,代码行数:22,代码来源:StartCommand.java


示例2: handleInternal

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
/**
 * Shows a performance statistic from finished trades
 *
 * @throws TelegramApiException if any error occur while using Telegram API
 */
@Override
protected void handleInternal(String[] params) throws Exception {

    if (runner.getState() != State.RUNNING) {
        telegramService.sendMessage("`trader is not running`");
        return;
    }

    List<TradeEntity> trades = tradeService.findAllClosedTrade();

    Map<CurrencyPair, BigDecimal> pairRates = trades.stream()
            .collect(Collectors.toMap(t -> new CurrencyPair(t.getPair()),
                    TradeEntity::getCloseProfit,
                    (leftProfit, rightProfit) -> leftProfit.add(rightProfit)));

    List<Pair<CurrencyPair, BigDecimal>> pairRatesList = pairRates.entrySet().stream()
            .map(entry -> Pair.of(entry.getKey(), entry.getValue()))
            .sorted(Comparator.comparing(Pair::getRight))
            .sorted(Comparator.reverseOrder())
            .collect(Collectors.toList());

    StringBuilder messageBuilder = new StringBuilder("<b>Performance:</b>\n");
    for (int i = 0; i < pairRatesList.size(); i++) {
        Pair<CurrencyPair, BigDecimal> pairProfit = pairRatesList.get(i);
        messageBuilder.append(i + 1).append('.');
        messageBuilder.append("<code>").append(pairProfit.getLeft()).append('\t');
        messageBuilder.append(pairProfit.getRight().round(new MathContext(2)).toString()).append("%</code>\n");
    }
    messageBuilder.append("\n");

    String message = messageBuilder.toString();
    LOGGER.debug(message);
    telegramService.sendMessage(message, ParseMode.HTML);
}
 
开发者ID:jeperon,项目名称:freqtrade-java,代码行数:40,代码来源:PerformanceCommandHandler.java


示例3: onUpdateReceived

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public void onUpdateReceived(Update update) {
	
	if(update.hasMessage()) {
		Message message = update.getMessage();
		String[] command = message.getText().split(" ");

		if(command[0].startsWith("/") && commandHash.containsKey(command[0])) {
			commandHash.get(command[0]).run(update, this);
			logger.write(update);
		} 
		
		else {
			SendMessage sm = new SendMessage();
			sm.setChatId(update.getMessage().getChatId());

			sm.setParseMode(ParseMode.HTML);
			
			sm.setText("Comando Inválido. Digite <b>/ajuda</b> para a lista de comandos.");
			try {
				sendMessage(sm);
			} catch (TelegramApiException e) {
				e.printStackTrace();
			}
		}
		
	}
	
}
 
开发者ID:InsightLab,项目名称:telegram-bots,代码行数:29,代码来源:QualisBot.java


示例4: enableMarkdown

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public InputTextMessageContent enableMarkdown(boolean enable) {
    if (enable) {
        this.parseMode = ParseMode.MARKDOWN;
    } else {
        this.parseMode = null;
    }
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:9,代码来源:InputTextMessageContent.java


示例5: enableHtml

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public InputTextMessageContent enableHtml(boolean enable) {
    if (enable) {
        this.parseMode = ParseMode.HTML;
    } else {
        this.parseMode = null;
    }
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:9,代码来源:InputTextMessageContent.java


示例6: enableMarkdown

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public EditMessageText enableMarkdown(boolean enable) {
    if (enable) {
        this.parseMode = ParseMode.MARKDOWN;
    } else {
        this.parseMode = null;
    }
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:9,代码来源:EditMessageText.java


示例7: enableHtml

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public EditMessageText enableHtml(boolean enable) {
    if (enable) {
        this.parseMode = ParseMode.HTML;
    } else {
        this.parseMode = null;
    }
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:9,代码来源:EditMessageText.java


示例8: enableMarkdown

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public SendMessage enableMarkdown(boolean enable) {
    if (enable) {
        this.parseMode = ParseMode.MARKDOWN;
    } else {
        this.parseMode = null;
    }
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:9,代码来源:SendMessage.java


示例9: enableHtml

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public SendMessage enableHtml(boolean enable) {
    if (enable) {
        this.parseMode = ParseMode.HTML;
    } else {
        this.parseMode = null;
    }
    return this;
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:9,代码来源:SendMessage.java


示例10: getSendMessage

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public static BotApiMethod getSendMessage() {
    return new SendMessage()
            .setChatId("@test")
            .setText("Hithere")
            .setReplyToMessageId(12)
            .setParseMode(ParseMode.HTML)
            .setReplyMarkup(new ForceReplyKeyboard());
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:9,代码来源:BotApiMethodHelperFactory.java


示例11: getEditMessageText

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
public static BotApiMethod getEditMessageText() {
    return new EditMessageText()
            .setChatId("ChatId")
            .setMessageId(1)
            .setText("Text")
            .setParseMode(ParseMode.MARKDOWN)
            .setReplyMarkup(getInlineKeyboardMarkup());
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:9,代码来源:BotApiMethodHelperFactory.java


示例12: sendMessage

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
@Override
public void sendMessage(String message) throws TelegramApiException {
    sendMessage(message, ParseMode.MARKDOWN);
}
 
开发者ID:jeperon,项目名称:freqtrade-java,代码行数:5,代码来源:TelegramServiceImpl.java


示例13: getInputMessageContent

import org.telegram.telegrambots.api.methods.ParseMode; //导入依赖的package包/类
private static InputMessageContent getInputMessageContent() {
    return new InputTextMessageContent()
            .setMessageText("Text")
            .setParseMode(ParseMode.MARKDOWN);
}
 
开发者ID:samurayrj,项目名称:rubenlagus-TelegramBots,代码行数:6,代码来源:BotApiMethodHelperFactory.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProcessListener类代码示例发布时间:2022-05-23
下一篇:
Java FixedValue类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap