clever-bot-api

1.5.4 • Public • Published

Basic Usage

const ai = require("clever-bot-api")

ai("Hello, there").then( res => console.log(res) )

Context

function log(a){ console.log(a) }
// You can pass a context (message history) for more meaningful results
const history = ["Hi", "Are you ok?"]
ai("Yes i'm fine", history).then(log)

//Alternatively, you can pass a channel ID to automatically manage history
const channel = "chat-1", channel2 = "chat-2";
ai("Hi", channel).then(log)
ai("Yes i'm fine", channel).then(log) //takes context from channel1 (2 messages)

ai("Hello!", channel2) //takes context from channel2 (no messages)

Readme

Keywords

Package Sidebar

Install

npm i clever-bot-api

Weekly Downloads

304

Version

1.5.4

License

MIT

Unpacked Size

2.87 kB

Total Files

3

Last publish

Collaborators

  • blobkat