GithubHelp home page GithubHelp logo

better-cleverbot-client's Introduction

better-cleverbot

Important Notice

This module is a rewrite of the node module of cleverbot.io

Installation

To install this package, simply enter the following in your console

npm install --save better-cleverbot-io

Note: It is a good practice to include --save to add this to your dependencies in your package.json

Setup

Before using this module, please get your API keys at http://cleverbot.io/keys

To initialize cleverbot, require the module, then create a new instance of cleverbot.

The nick should be a unique identifier.

You have to create and initialize a fresh instance of better-cleverbot-io, if you want to have different sessions without having to switch back and forth with setNick(sessionName)

var cleverbot = require("better-cleverbot-io"),
bot = new cleverbot({user:'YOUR_API_USER', key:'YOUR_API_KEY',nick:'YOUR Session ID'});

Initalizing the module

to initalize the module use the following:

bot.create().then(() => {
    //You just initialized the module :)
}).catch(err => {
//if anything weird happend, you will find it here.
});

Querying Cleverbot

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

bot.ask("Just a small town Wolke").then((response => {
  console.log(response); // Will likely be: "Living in a uwu World"
});

For easy switching this module has legacy methods that work the same as cleverbot.io

Just add "Legacy" to the function name.

This client is using cleverbot.io

better-cleverbot-client's People

Contributors

daswolke avatar macdja38 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

macdja38

better-cleverbot-client's Issues

Bad request?

When I try to query, I get this error

Error: Request failed with status code 400
    at createError (C:\Users\cat\drive\JS\blargbot\node_modules\axios\lib\core\createError.js:15:15)
    at settle (C:\Users\cat\drive\JS\blargbot\node_modules\axios\lib\core\settle.js:18:12)
    at IncomingMessage.handleStreamEnd (C:\Users\cat\drive\JS\blargbot\node_modules\axios\lib\adapters\http.js:186:11)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

This seems to happen with the official driver too. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.