I am trying to set up a Java Telegram bot using the following wrapper.
I have Maven/Java 8 setup on my machine using Visual Code, following this guide.
I used the standard issue Maven quick start archetype and added the telegram bot wrapper dependency to my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.carrein.maya</groupId>
<artifactId>Maya</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Maya</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.telegram</groupId>
<artifactId>telegrambots</artifactId>
<version>3.6</version>
</dependency>
</dependencies>
</project>
After which i used mvn dependency:resolve
.
My class is setup as follows:
package com.carrein.maya;
import org.telegram.*;
import org.telegram.telegrambots.*;
public class Maya extends TelegramLongPollingBot {
@Override
public String getBotUsername() {
return null;
}
@Override
public String getBotToken() {
return null;
}
@Override
public void onUpdateReceived(final Update update) {
}
}
However I get the following error on running mvn -B verify
:
[19,3] method does not override or implement a method from a supertype.
I not sure how to resolve the following error as I have already imported the package org.telegram.*
into my class file.
I assumed that it would work as the generated AppTest.java
file has a import junit.framework.Test;
declaration on top, which is also a dependency in the pom.xml.