akito

Akito is a npm with discord.js reaction menu, database, chatbot, random stuff and more! The docs website is https://akitoweb.netlify.app/ or below for docs.

Usage no npm install needed!

<script type="module">
  import akito from 'https://cdn.skypack.dev/akito';
</script>

README

akito

Akito is a npm with discord.js reaction menu, database, chatbot, random stuff and more! The docs website is https://akitoweb.netlify.app/ or below for docs.


NPM version NPM downloads

NPM install


Table of contents


Installation

First install Node.js Next install the npm

npm install akito

Usages

Importing

//nodejs require
const akito = require("akito");

//es6 imports
import akito from "akito";

Random

Making a random array

const akito = require('akito');
akito.randomArray;

const array = ['hello!', 'bye!']
const random = akito.randomArray(array)

console.log(random);

Making a random number

const akito = require('akito');
const number = akito.randomNumber;

//gets a number from 1 to 100
const random = number(1, 100)
console.log(random)

Making a random coinflip

const akito = require('akito');
const coin = akito.randomCoin;

console.log(coin);

Generating random text

const akito = require('akito');
const text = akito.randomString;

//gets 5 random text
const random = text(5)
console.log(random)

Generating a random word

const akito = require('akito');

async function data() {
  const word = await akito.randomWord;
  console.log(`Word: ${await word()}`);  
}

data()

Time

Converting miliseconds to normal time

const akito = require('akito');
const time = akito.milliseconds;

//5000 miliseconds to normal time
const convert = time(5000)
console.log(convert)

Chatbot

Chat bot like talking to an ai

const akito = require('akito');
const chat = akito.chatBot;

//hello is the message
//1 is the id
async function yourcode() {
  const ai = await chat('hello!', '1')
  //then you can use ai 
  //further code...
}
//requiring your async function/code
yourcode()

ReactionMenu

Making a reaction menu
Example (Note: this function only works with discord bots)

const akito = require('akito');
const Discord = require('discord.js');

const client = new Discord.Client();

client.on('ready', () => {
  console.log('Yay I am online!')
})

client.on('message', async message => {
  if (message.content === 'reactionmenu') {
    //you can use the embeds in any way you like!
    const test = new Discord.MessageEmbed().setTitle('Hello!')
    const test1 = new Discord.MessageEmbed().setTitle('Bye!')

    //make new reaction menu
    akito.reactionMenu(
    //uses the message.author.id
    message.author.id,
    //uses the message.channel
    message.channel,
    //time in miliseconds the reactions are gonna stay
    60000,
    //now here you can put all your embeds
    //the max is 6 of these
    test,
    test1
) //the end of the new reaction menu
  //dont worry about sending the message as it already does that
  }
})

client.login('discord bot token here')

How it looks

Database

Adding numbers to your database

const akito = require('akito');
const add = akito.dbAdd;

add('object', 'value')

Adding text to your database

const akito = require('akito');
const set = akito.dbSet;

set('object', 'value')

Removing data from your database

const akito = require('akito');
const del = akito.dbDelete;

del('object')

Fetching data from your database

const akito = require('akito');
const fetch = akito.dbFetch;

fetch('object')

Subtracting numbers from your database

const akito = require('akito');
const subtract = akito.dbSubtract;

subtract('object', 'value')

Getting all the data in a array from your database

const akito = require('akito');
const all = akito.dbAll;

all('object')

Go to the top
Here