npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tamako-api

v1.5.1

Published

A package for using the Tamako API Easily!

Downloads

8

Readme

Tamako-API

Quick Tamako API wrapper for beginners.

App Version Node License

Tamako-API

Features

  • Beginner friendly
  • Ideal for beginner Discord Bot creators
  • Easy to use

Quick Example

// Destructure the class from the library
const { TAMAKOAPI } = require("tamako-api");

// Note: Username, id, and secret are important, you should store them
// in an environment variable whenever possible and be kept private at all times

// Instantiate the class before you can use it
// Parameters are only required if you want to use the chatbot method
// You can get your own username, id, and secret here -> https://appcenter.theskyfallen.com/
// chatbot parameter is optional
const tamako = new TAMAKOAPI({
 svcid: process.env.TAMAKO_SERVICEID,
 prvid: process.env.TAMAKO_PROVISIONID,
 svcsecret: process.env.TAMAKO_SECRET,
 chatbot: {
   name: "The name for the bot",
   gender: "The assumed gender of the bot",
   prefix: "The prefix of your bot",
   dev: "The creator of your bot (naturally it is you)"
   }
});

// Using default values for options found in tamako.cboptions
tamako.chatbot('hello there', { user: '123456' }).then((response) => {
   console.log(response);
});

// Using own values without using the options found on tamako.cboptions
tamako.chatbot('hello there', {
   name: "The name for the bot",
   gender: "The assumed gender of the bot",
   user: "123456",
   prefix: "The prefix of your bot",
   dev: "The creator of your bot (naturally it is you)"
}).then(response => console.log(response));

// Fires whenever an error occurs
tamako.on("error", error => {
   console.log(error);
});

Authenticated Functions

chatbot(message, options)

Note: Requires authentication Returns message sent by the chatbot or undefined (if error occurs)

| Parameter | Type | Default | Optional | Description | | - | - | - | :-: | - | | message | string | none | ❌ | The message you want the chatbot to reply with | options.name | string | Tamako | ✔️ | The name of the chatbot | options.gender | string | female | ✔️ | The gender of the chatbot | options.user | string | none | ❌ | Unique ID to tell users using the endpoint apart | options.prefix | string | Not Set By Developer | ✔️ | It should be your bot's prefix | options.dev | string | Bear#3437 | ✔️ | Name Of the developer of the bot

Unauthenticated Functions

lyrics(name)

Returns lyrics of the song from the name | Parameter | Type | Default | Optional | Description | | - | - | - | :-: | - | | name | string | none | ❌ | The title of the song |

Example

const { TAMAKOAPI } = require('tamako-api');
const tamako = new TAMAKOAPI();

tamako.lyrics('In the End')
.then(res => {
const lyrics = res.lyrics;
const cover = res['album-art'];
const artist = res.artist;
const link = res.link

console.log(lyrics, cover, artist, link);
});

pokemon(name)

Returns an object containing information about the Pokemon | Parameter | Type | Default | Optional | Description | | - | - | - | :-: | - | | name | string | none | ❌ | The name of the pokemon |

Example

const { TAMAKOAPI } = require('tamako-api');
const tamako = new TAMAKOAPI();

tamako.pokemon('pikachu')
.then(res => console.log(res));

joke()

Returns a random joke

Example

const { TAMAKOAPI } = require('tamako-api');
const tamako = new TAMAKOAPI();

tamako.joke()
.then(joke => console.log(joke));

animalfact(name)

Returns a fact of the mentioned animal

name can be any of the following: | | | | | | | | | | | | | | - | - | - | - | - | - | - | - | - | - | - | - | | bird | bunny | cat | dog | fox | giraffe | kangaroo | koala | panda | racoon | whale | elephant |

Example

const { TAMAKOAPI } = require('tamako-api');
const tamako = new TAMAKOAPI();

tamako.animalfact('dog')
.then(res => console.log(res))

image(type)

Returns an image link

type can be any of the following: | | | | | | | | | | | | - | - | - | - | - | - | - | - | - | - | | bird | dog | cat | dog | fox | koala | panda | redpanda | tamako | mai |

Example

const { TAMAKOAPI } = require('tamako-api');
const tamako = new TAMAKOAPI();

tamako.image('dog')
.then(res => console.log(res))

roleplay(type)

Returns a gif image link

type can be any of the following: | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |- | | baka | bite | blush | celebrate | cry | dance | disgust | eat | explode | feed | fistbump | happy | highfive | holdhands | hug | inhale | kill | kiss | lick | midfing | pat | poke | punch | slap | sleep | smug | tickle | wave | wink |

Example

const { TAMAKOAPI } = require('tamako-api');
const tamako = new TAMAKOAPI();

tamako.roleplay('hug')
.then(res => console.log(res))

Events

error - Returns an error if an error is returned from the API. Example

tamako.on('error', (err) => {
  console.log('Encountered an error:' + err.message)
})

Links