1.1.8 • Published 4 years ago

cheweybot-api-wrapper v1.1.8

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

Cheweybot-api-wrapper

A simply wrapper for https://api.chewey-bot.ga api

Installation

npm i cheweybot-api-wrapper

How to get token

  1. Join discord server
  2. Ran command in commands channel !role-me api-user
  3. DM Chewey Bot and ran !claim-api-key

If you couldn't DM not the bot please check your privacy settings

How to use

let cheweybotapi = require('cheweybot-api-wrapper')

cheweybotapi.login(Token); //It must be once in all your code
    cheweybotapi.image.get('cat').then((res)=>{
        console.log(res)
    }).catch((err)=>{
        console.log(err)
    })

/*[ 'space',
    'cat',
    'dog',
    'birb',
    'nature',
    'fantasy-art',
    'plane',
    'otter',
    'rabbit',
    'snake',
    'car',
    'turtle',
    'duck',
    'panda',
    'wolf',
    'fox' ]
*/

api.mc('mc.hypixel.net').then((res)=>{
    console.log(res)
}).catch((err)=>{
    console.log(err)
})

api.analytics.init(client,'236627494764150784')

or

let cheweybotapi = require('cheweybot-api-wrapper')

cheweybotapi.image.get('cat', TOKEN).then((res)=>{
        console.log(res)
    }).catch((err)=>{
        console.log(err)
    })

api.mc('mc.hypixel.net', TOKEN).then((res)=>{
    console.log(res)
}).catch((err)=>{
    console.log(err)
})

api.analytics.init(client,'236627494764150784', TOKEN)

Usage

Call this module

let cheweybotapi = require('cheweybot-api-wrapper') 

List of feature

Text between [] is not require

Main usage

cheweybotapi.login(token) : Note if using this, ',token' in calling function is not require
cheweybotapi.image.get(url,token)
cheweybotapi.mc(ip,token)
cheweybotapi.analytics.init(lib, ownerid,token)

Other Function

cheweybotapi.analytics.stop() : Disabled analytics autoposting
cheweybotapi.analytics.start() : Enabled analytics autoposting

Response

All endpoints respond

//Image and MC
{data:'your-image'}

Error

Each error is specified

Exemple Error:

Noendpointfind: {
  name: 'Noendpointfind', //Name of this error
  message: 'No endpoint find', // description of this error
  status: '0x00404' //Error code (for all error codes, it is below)  
}

Endpoint

Image

space,cat,dog,bird,nature,fantasy-art,plane,otter,rabbit,snake,car,turtle,duck,panda,wolf,fox

MC API

Analytics

Link

Support server, Website API

Credit

Thanks to Chewey#1635 for accepting the creation of this module

Notes

Error Code

Error codesSignification
0x00001No token specified
0x00002No endpoint specified
0x00403Incorrect login
0x02403Incorrect lib
0x00404No endpoint find
0x01404No IP specified
0x02404No lib specified (discord.js or eris)
0x03404No owner ID specified
1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago