Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please help #332

Open
Sasha32global opened this issue Jan 30, 2025 · 0 comments
Open

Please help #332

Sasha32global opened this issue Jan 30, 2025 · 0 comments

Comments

@Sasha32global
Copy link

How can i send messages with timer? When i try this code:

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());
}

What i'm doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant