cheweybot-api-wrapper
v1.1.8
Published
A simply wrapper for cheweybot-api
Downloads
120
Maintainers
Readme
Cheweybot-api-wrapper
A simply wrapper for https://api.chewey-bot.ga api
Installation
npm i cheweybot-api-wrapper
How to get token
- Join discord server
- Ran command in commands channel
!role-me api-user
- 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
Credit
Thanks to Chewey#1635 for accepting the creation of this module
Notes
Error Code
| Error codes | Signification | | ------------- |:-------------:| | 0x00001 | No token specified | |0x00002|No endpoint specified| |0x00403|Incorrect login| |0x02403|Incorrect lib | 0x00404 | No endpoint find | |0x01404|No IP specified| |0x02404|No lib specified (discord.js or eris)| |0x03404|No owner ID specified|