This API uses Rubenlagus' library for Java.
To add this API to your project you need to add dependency.
If you use maven, add to pom.xml following text:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.MYnimef</groupId>
<artifactId>telegrambot-java</artifactId>
<version>0.0.2</version>
</dependency>
If you use gradle, add to build.gradle following text:
repositories {
...
maven {
url 'https://jitpack.io'
}
}
dependencies {
...
implementation 'com.github.MYnimef:telegrambot-java:0.0.2'
}
If your bot receives/sends messages with text that isn't supported in ANSII, you should add to build.gradle the following lines:
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
public class Main {
public static void main(String[] args) {
IBot bot = new BotCreator(
"token",
"username"
)
.start();
}
}
- Rubenlagus for Telegram Bot JAVA API