try {
printf("Bot username: %s\n", bot.getApi().getMe()->username.c_str());
TgBot::TgLongPoll longPoll(bot);
while (true) {
time_t ttime = time(0);
tm* local_time = localtime(&ttime);
if (local_time->tm_hour == 10 && local_time->tm_min == 57) {
printf("Report send in\n" + local_time->tm_hour + local_time->tm_min);
bot.getEvents().
bot.getApi().sendMessage(IdAdmin, u8"Recieved message?");
}
longPoll.start();
}
}
catch (TgBot::TgException& e) {
printf("error: %s\n", e.what());
}
How can i send messages with timer? When i try this code:
What i'm doing wrong?