UNPKG

clever-bot-api

Version:

Better AI!

22 lines (17 loc) 637 B
# Basic Usage ```js const ai = require("clever-bot-api") ai("Hello, there").then( res => console.log(res) ) ``` # Context ```js 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) ```