cherry-api-wrapper

1.0.3 • Public • Published

Bot logo

cherry-api-wrapper


🤖 This node module is a wrapper for the ch$rry API.

📝 Table of Contents

💭 How it works

This module is powered by node-fetch.

You request a certain method from the module -> module interacts with https://api.cherrybot.xyz -> https://api.cherrybot.xyz sends back JSON data -> module returns the JSON data to you.

🎈 Example

const API = require('cherry-api-wrapper')
const apikey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

let eightball = await new API.Fun().eightball('Will i be successful?', apikey)
console.log(eightball) // { status: 200, question: 'Will i be successful?', answer: 'Yes - definitely.' }

let img = await new API.Images().blush(apikey)
console.log(img) // { status: 200, image: 'https://cdn.cherrybot.xyz/images/blush/blush_38.gif', id: 38 }

let data = await new API.Valorant().userInfo(apikey, 'Example#0000')
console.log(data) // { status: 200, data: [Object] }

🔄 Methods

📷 Images

API.Images().blush(apikey)
API.Images().cry(apikey)
API.Images().hug(apikey)
API.Images().kiss(apikey)
API.Images().pat(apikey)
API.Images().punch(apikey)
API.Images().slap(apikey)

🧸 Fun

API.Fun().eightball(question, apikey)
API.Fun().advice(apikey)
API.Fun().fortune(apikey)
API.Fun().insults(apikey)

🎮 Valorant

API.Valorant().userInfo(apikey, 'Example#0000') // { status: 200, data: [Object] }

⚠️ Rate Limits

The ch$rry API allows you to make a request per second to prevent spam. If you make a request while your on the 1 second rate limit it will return a 429 status code "The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time."

🔒 API Keys

To apply for a ch$rry API key join our Discord server (https://cherrybot.xyz/discord) and make a ticket explaining what you are using the API key for! (We are accepting easily and not being strict about it and youll probably get accepted within an hour or two.)

⛏️ Built Using

  • node.js - Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.
  • node-fetch - A light-weight module that brings window.fetch to Node.js

✍️ Authors

  • @clap - Developer of the ch$rry API, wrapper and discord bot.

Readme

Keywords

none

Package Sidebar

Install

npm i cherry-api-wrapper

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

9.11 kB

Total Files

6

Last publish

Collaborators

  • clapan