CleverBot4J is a java api wrapper for cleverbot.io
Unfortunately this api has died
- Repository: jitpack
- Artifact: com.github.duncte123:CleverBot4J:-SNAPSHOT
Using in Gradle:
repositories {
maven {
name 'jitpack'
url 'https://jitpack.io'
}
}
dependencies {
compile 'com.github.duncte123:CleverBot4J:-SNAPSHOT'
}
Using in Maven:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.duncte123</groupId>
<artifactId>CleverBot4J</artifactId>
<version>-SNAPSHOT</version>
</dependency>
First you need to get an api and user key from this page.
When you have done that you can set the api up like this.
You can use setKeys(user, api)
if you want to set both keys at once.
The nickname is optional
CleverbotAPI api = new CleverbotBuilder()
.setUserKey("CLEVERBOT_USER_KEY")
.setApiKey("CLEVERBOT_API_KEY")
.setNickname("Cleverbot4J")
.build();
To send questions to the bot you can use the askQuestion
method.
String answer = api.askQuestion("How are you?");