fixed compiler warning, api defaults to long polling
This commit is contained in:
parent
5f8dc8875d
commit
36521f20ad
|
@ -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>
|
2
pom.xml
2
pom.xml
|
@ -50,6 +50,8 @@
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<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>
|
</properties>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -42,12 +42,12 @@ public class TelegramAPI implements Runnable {
|
||||||
public static final String APIVERSION = "3.8";//May 18, 2019
|
public static final String APIVERSION = "3.8";//May 18, 2019
|
||||||
|
|
||||||
private int msg_offset = 0;
|
private int msg_offset = 0;
|
||||||
private int updateInterval = 1500;
|
private int updateInterval = 60;
|
||||||
private String apikey;
|
private String apikey;
|
||||||
private String botname;
|
private String botname;
|
||||||
private Thread thread;
|
private Thread thread;
|
||||||
private boolean run = true;
|
private boolean run = true;
|
||||||
private boolean longpolling = false;
|
private boolean longpolling = true;
|
||||||
public boolean isLongpolling() {
|
public boolean isLongpolling() {
|
||||||
return longpolling;
|
return longpolling;
|
||||||
}
|
}
|
||||||
|
@ -382,6 +382,10 @@ public class TelegramAPI implements Runnable {
|
||||||
return evntmgr;
|
return evntmgr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* seconds to wait for longpolling or milliseconds to wait petween shortpolling
|
||||||
|
* @param d
|
||||||
|
*/
|
||||||
public void setUpdateInterval(int d) {
|
public void setUpdateInterval(int d) {
|
||||||
if(d < 0)
|
if(d < 0)
|
||||||
throw new IllegalArgumentException("UpdateInterval is not allowed to be negative.");
|
throw new IllegalArgumentException("UpdateInterval is not allowed to be negative.");
|
||||||
|
|
Loading…
Reference in New Issue