To install this package, enter the following in your console

go get

Before using this module, please get your API keys at


To initialize the Cleverbot, create a new instance.

package main

import (


func main() {
    // The api key is given to you at
    apiUser := "YOUR_API_USER"
    apiKey := "YOUR_API_KEY"

    // apiNick is optional.
    apiNick := ""

    // Initialize Cleverbot
    bot, err := cleverbot.New(apiUser, apiKey, apiNick)
    if err != nil {
    } allows you to save cleverbot sessions to access later. To utilize this feature, you can create a new instance with a third parameter.

// apiNick is optional.
    apiNick := "sessionName"

Now querying the cleverbot is simple, you pass the text to the .Ask() method

// Send Cleverbot a message.
    response, err := bot.Ask("hello world")
    if err != nil {

    // Print the response.
    // "World? Who is world? My name is Timmy."

For more examples:

Well, that's it for now! Happy hacking!