С++ Форматирование текста в тг боте / tgbot/tgbot.h
Пытаюсь сделать вывод текста ботом жирным форматом, не получается, хоть на сайте Api написано делать через text. Вот код:
#include <iostream>
#include <stdio.h>
#include <string>
#include <tgbot/tgbot.h>
#include <vector>
#include <ctime>
using namespace TgBot;
using namespace std;
vector<string>bot_commands = { "start", "time", "proizvod", "integral" };
int main()
{
setlocale(LC_ALL, "ru_RU.UTF-8");
bot_main.getEvents().onCommand("start", [&bot_main](Message::Ptr message)
{
bot_main.getApi().sendMessage(message->chat->id, "**hi, **" + message->chat->firstName + "\n/help -" + " / proizvod - command for picture proizvod.\n" +
"/integral - command for picture integralov");
int64_t chatId = message->chat->id;
string text = "<b>Привет!</b>\nЭто жирное сообщение!";
bot_main.getApi().sendMessage(chatId, text, "HTML");
});
try
{
printf("Bot username: %s\n", bot_main.getApi().getMe()->username.c_str());
TgLongPoll longPoll(bot_main);
while (true) {
printf("Long poll started\n");
longPoll.start();
}
}
catch (TgException& e)
{
printf("error: %s\n", e.what());
}
return 0;
}
p.s. вставлена только часть кода, по сути урезал то что не должно просто мешать