Socket
Socket
Sign inDemoInstall

suyamiko-api

Package Overview
Dependencies
1
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    suyamiko-api

A suyamiko/suya.moe api client


Version published
Maintainers
2
Install size
43.9 kB
Created

Readme

Source

NPM version NPM downloads Dependencies Paypal

Suyamiko-API

A simple wrapper around the Suyamiko Bot's API

A bridge to the world of moe (and other services provided by the suya.moe API)!

npm install suyamiko-api@1.0.1

https://api.suya.moe/cdn.gif?awoo=SGs0VlhIbVBiZQ.gif

awoo

The Suyamiko API is private, thus this package is not meant to be used by people who do not have prior authorization to use it.

Easy setup

const ApiClient = require('suyamiko-api');
const token = 'API TOKEN HERE';

const client = new ApiClient(token); // To set a new token: client.set_token('new token')

client.neko().then(console.log)
const another_url = await client.neko();

Endpoints is defined as:

const endpoints = [
  'neko', 'awoo', 'bang', 'bite', 'blush',
  'cat', 'cry', 'cuddle', 'dance', 'hug',
  'kiss', 'lewd', 'lick', 'lizard', 'neko',
  'nom', 'nuzzle', 'pat', 'poke', 'pout',
  'shrug', 'slap', 'sleepy', 'tickle'
];

Any of these are methods of the client:

client.cuddle(), client.slap(), etc

All endpoints return promises that resolve to a url. As with all promises, append a .catch to catch errors if not using await.

try {
  const url = await client.pout();
} catch (err) {
  console.error(err);
}

Request handling errors (hopefully) contain three properties: error, code, and message

• error contains an Error object with a stack trace error.stack

• code contains the status code of the request

• message contains the body returned by the server. If possible, it will be a parsed JSON.

Common errors:

Error code 401, message { error: 'Invalid Authorization Received for protected endpoint' }

• Problem: The key you provided was invalid. • Solution: Contact the owner of the API on discord via Kazuko#0180

Other errors: Open an issue on github or contact me on discord at William Zhou#0001 via https://discord.gg/jj5FzF7

Keywords

FAQs

Last updated on 18 Nov 2020

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc