dunctes-archive / CleverBot4J

A java api wrapper for cleverbot.io
Apache License 2.0
1 stars 0 forks source link
cleverbot cleverbot-api gradle java java-api maven

CleverBot4J

CleverBot4J is a java api wrapper for cleverbot.io

Cleverbot.io is dead

Unfortunately this api has died

maven package

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>

Usage

Setting the api up

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?");