fixed compiler warning, api defaults to long polling

This commit is contained in:
mrbesen 2019-05-20 19:35:12 +02:00
förälder 5f8dc8875d
incheckning 36521f20ad
Signerad av: MrBesen
GPG-nyckel ID: 596B2350DCD67504
3 ändrade filer med 23 tillägg och 3 borttagningar

14
TelegramAPI.iml Normal file
Visa fil

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

Visa fil

@ -50,6 +50,8 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
</project>

Visa fil

@ -42,12 +42,12 @@ public class TelegramAPI implements Runnable {
public static final String APIVERSION = "3.8";//May 18, 2019
private int msg_offset = 0;
private int updateInterval = 1500;
private int updateInterval = 60;
private String apikey;
private String botname;
private Thread thread;
private boolean run = true;
private boolean longpolling = false;
private boolean longpolling = true;
public boolean isLongpolling() {
return longpolling;
}
@ -381,7 +381,11 @@ public class TelegramAPI implements Runnable {
public EventManager getEventManager() {
return evntmgr;
}
/**
* seconds to wait for longpolling or milliseconds to wait petween shortpolling
* @param d
*/
public void setUpdateInterval(int d) {
if(d < 0)
throw new IllegalArgumentException("UpdateInterval is not allowed to be negative.");