The Unofficial Patch to Alexa-Bot-API
Brought to you by the CWN Team
Enjoying alexa-bot-api?
Consider Donating To Me:
https://www.buymeacoffee.com/nithishpravin
Join My Discord Server:
https://discord.gg/m2G7YB3ttf
Developers:
Credits:
- - Pudochu - Discord: Pudochu 'D#0001 - Involvement: Helped in the previous fix and suggestions about the package
- - BlobKat#0388: Updated to support contextual AI
Whats new in v3.0.6
- - Fixed cleverbot's new API update that lead to package not working
- - Added Context support
- - Relaunched the long awaited for API
- - Fixed
ReferenceError: comp is not defined
Error
Whats to be expected in the future?
We have spent lots of time working on this patch, and have encountered lots of issues,
but we're proud to say that we're going to be adding personality fields on top of better multi-lingual support
Our RoadMap
3.0.5 | Multi-Lingual | A jaro winkler check to enhance the consitency in messages | OK ✔ |
3.1.0 | N/A | Additional Personalities | Pending... |
3.2.0 | N/A | ❌ | Unknown... |
Coded Examples:
Promise Based!
const alexa = require("alexa-bot-api-v3");
const ai = new alexa();
ai.getReply("Hello", [], "english", "O_o").then((reply) => {
console.log(reply);
});
Contextual AI:
getReply(<message>, <context>, <language>, <replacer>)
A further expansion on Contextual AI:
const Discord = require("discord.js");
const bot = new Discord.Client();
const alexa = require("alexa-bot-api-v3");
const ai = new alexa();
bot.on("message", function (msg) {
if (msg.author.bot || !msg.content.startsWith(prefix)) return;
let context = [];
if (msg.content.startsWith(`${prefix}chat`)) {
let input = msg.content.replace(`${prefix}chat`);
ai.getReply(input, context, "english", "OwO").then(reply => {
msg.reply(reply);
context.push(reply);
});
}
});
bot.login("Your.super-secret.Token");
Async / Await
const alexa = require("alexa-bot-api-v3");
const ai = new alexa();
const context = [];
async function main() {
const reply = await ai.getReply("How are you mate?", context, "english", "UwU");
console.log(reply);
}
main();