Skip to content

CleverbotIO/go-cleverbot.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card GoDoc

cleverbot.io

A Go wrapper for Cleverbot.io.

Installation

go get github.com/CleverbotIO/go-cleverbot.io

Usage

// Package main provides a basic example of using go-cleverbot.io.
package main

import (
	"fmt"
	"log"

	"github.com/CleverbotIO/go-cleverbot.io"
)

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

	// apiNick is optional.
	apiNick := ""

	// Initialize Cleverbot
	bot, err := cleverbot.New(apiUser, apiKey, apiNick)
	if err != nil {
		log.Fatal(err)
	}

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

	// Print the response.
	fmt.Println(response)
	// "World? Who is world? My name is Timmy."
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages