added convient method send Async

This commit is contained in:
mrbesen 2019-05-07 16:10:50 +02:00
parent 9616c0b2fb
commit 3c6c0328ce
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
2 changed files with 22 additions and 0 deletions

18
TelegramAPI.iml Normal file
View File

@ -0,0 +1,18 @@
<?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" />
<orderEntry type="library" name="Maven: com.google.guava:guava:20.0" level="project" />
<orderEntry type="library" name="Maven: org.json:json:20180130" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.11.1" level="project" />
</component>
</module>

View File

@ -160,6 +160,10 @@ public class TelegramAPI implements Runnable {
s.close();
return sb.toString();
}
public void sendAsync(long chatid, String msg) {
sendMessage(new MessageBuilder().setAsync().setReciver(chatid).setText(msg).build());
}
public TMessage sendMessage(TUser user, String text) {
MessageBuilder builder = new MessageBuilder();