Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Please help #332

Copy link
Copy link
@Sasha32global

Description

@Sasha32global
Issue body actions

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?

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.