🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

alexa-bot-api-v3

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

alexa-bot-api-v3

A very lightweight and simple artificial intelligence with multi language support

3.0.8
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

The Unofficial Patch to Alexa-Bot-API
Brought to you by the CWN Team


As Declared in Issue 1 - Cease and Desist:

Alexa-Bot-API-v3 will be taken down on the 28th AEST Please find a new package if you wish to keep AI-like functionality

Enjoying alexa-bot-api?


Consider Donating To Me: https://www.buymeacoffee.com/nithishpravin

Join My Discord Server:

https://discord.gg/m2G7YB3ttf

Developers:

  • - Nithish Pravin - Discord: Nithish#6593
  • - KazutoKashima - Discord: Kaz += Sterben;#4547

    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

Versions:Patches?AdditionsStatus
3.0.5Multi-LingualA jaro winkler check to enhance the consitency in messagesOK ✔
3.1.0N/AAdditional PersonalitiesPending...
3.2.0N/AUnknown...

Coded Examples:


Promise Based!

const alexa = require("alexa-bot-api-v3");
const ai = new alexa();

// [] represents context, since it's an array
ai.getReply("Hello", [], "english", "O_o").then((reply) => {
  console.log(reply);
  //Do your stuffs with the reply
});

Contextual AI:


getReply(<message>, <context>, <language>, <replacer>)
//context: string | array
//string: a specific channel ID for context
//array: an array of previous messages

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;

    // it's better to store the context in a local databse
    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); // send the message
            context.push(reply); // add the response to the context
        });
    }
});

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);
  //Do your stuffs with reply
}
main();

Keywords

alexa

FAQs

Package last updated on 20 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts