Browse Source

fixed compiler warning, api defaults to long polling

master
mrbesen 6 months ago
parent
commit
36521f20ad
Signed by: mrbesen <y.g.2@gmx.de> GPG Key ID: 596B2350DCD67504
3 changed files with 23 additions and 3 deletions
  1. +14
    -0
      TelegramAPI.iml
  2. +2
    -0
      pom.xml
  3. +7
    -3
      src/main/java/de/mrbesen/telegram/TelegramAPI.java

+ 14
- 0
TelegramAPI.iml View File

@@ -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
- 0
pom.xml View File

@@ -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>

+ 7
- 3
src/main/java/de/mrbesen/telegram/TelegramAPI.java View File

@@ -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.");

Loading…
Cancel
Save