fixed compiler warning, api defaults to long polling
This commit is contained in:
父節點
5f8dc8875d
當前提交
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>
|
||||
<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>
|
|
@ -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.");
|
||||
|
|
載入中…
新增問題並參考