diff --git a/.gitignore b/.gitignore index 4782c17..23ed23a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ .settings/ target/ bin/ +.idea/ \ No newline at end of file diff --git a/TelegramAPI.iml b/TelegramAPI.iml deleted file mode 100644 index 597cd8e..0000000 --- a/TelegramAPI.iml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/de/mrbesen/telegram/TelegramAPI.java b/src/main/java/de/mrbesen/telegram/TelegramAPI.java index ca36023..eb4a993 100644 --- a/src/main/java/de/mrbesen/telegram/TelegramAPI.java +++ b/src/main/java/de/mrbesen/telegram/TelegramAPI.java @@ -37,7 +37,7 @@ import de.mrbesen.telegram.objects.TUser.Status; public class TelegramAPI implements Runnable { private static final String API_URL = "https://api.telegram.org/bot"; - private static final String TOKENREGEX = "^\\d{4,9}:[\\w-]{12,64}$"; + private static final String TOKENREGEX = "^\\d{4,10}:[\\w-]{12,64}$"; private static final int TELEGRAMFILESIZELIMIT = 20000000;//20MB filesize https://core.telegram.org/bots/api#sending-files public static final String APIVERSION = "3.8";//May 18, 2019 @@ -329,6 +329,10 @@ public class TelegramAPI implements Runnable { processUpdates(request("getUpdates", "offset=" + msg_offset + "&timeout=" + (longpolling ? updateInterval : 1), false)); } catch (IOException e) { log.log("error getting updates.", e); + + try { + Thread.sleep(100); + } catch(InterruptedException ignored) {} } }