diff --git a/src/telepathy/bot.cr b/src/telepathy/bot.cr index 141cb0e..fc49f2f 100644 --- a/src/telepathy/bot.cr +++ b/src/telepathy/bot.cr @@ -18,8 +18,9 @@ module Telepathy return Response(User).from_json(response.body).result end - def get_updates - update_data = {} of String => Int64 | String + def get_updates(timeout = 0) + update_data = {} of String => Int64 | Int32 | String + update_data["timeout"] = timeout @last_update_id.try { |id| update_data["offset"] = id } response = HTTP::Client.get(@request_base + "/getUpdates", headers: HTTP::Headers{"User-agent" => "Telepathy", "Content-type" => "application/json" },