3.0.8 • Published 3 years ago

alexa-bot-api-v3 v3.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

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

Join My Discord Server:

https://discord.gg/m2G7YB3ttf

Developers:

Whats new in v3.0.6

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? | Additions | Status | |:---------:|---------------|--------------------------|------------| | 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... |

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
});
getReply(<message>, <context>, <language>, <replacer>)
//context: string | array
//string: a specific channel ID for context
//array: an array of previous messages
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");
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();
3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago