Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SET(SRCS

ADD_DEFINITIONS("-DDEBUG=1")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
SET(DEPENDENTS "libcurl json")
SET(DEPENDENTS "libcurl json-c")
INCLUDE(FindPkgConfig)
pkg_check_modules(PKGS REQUIRED ${DEPENDENTS})

Expand Down
6 changes: 3 additions & 3 deletions test/echobot.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char *argv[])

telebot_free_me(me);

int index, count;
int index, count, offset = 1;
char str[4096];
telebot_error_e ret;
telebot_message_t message;
Expand All @@ -56,10 +56,9 @@ int main(int argc, char *argv[])
sleep(1);

telebot_update_t *updates;
ret = telebot_get_updates(handle, 1, 20, 0, NULL, 0, &updates, &count);
ret = telebot_get_updates(handle, offset, 20, 0, NULL, 0, &updates, &count);
if (ret != TELEBOT_ERROR_NONE)
continue;

printf("Number of updates: %d\n", count);
for (index = 0;index < count; index++) {
message = updates[index].message;
Expand All @@ -77,6 +76,7 @@ int main(int argc, char *argv[])
if (ret != TELEBOT_ERROR_NONE) {
printf("Failed to send message: %d \n", ret);
}
offset = updates[index].update_id + 1;
}
telebot_free_updates(updates, count);
}
Expand Down