Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

cheweyapi

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cheweyapi

NodeJS Wrapper for https://api.chewey-bot.top.

latest
Source
npmnpm
Version
2.0.4
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

Chewey API

An api wrapper for https://api.chewey-bot.top, with full api coverage as of 09/27/2023.
Consult the api's docs or the source code for endpoints.

Basic Usage

// commonjs
const CheweyAPI = require("cheweyapi");
// typescript
import CheweyAPI from "cheweyapi";

// an api key is REQUIRED
const chewey = new CheweyAPI("apiKey");

// returns an image url
// all endpoints on https://api.chewey-bot.top are supported
const birb = await chewey.images.birb(); 

// returns an array of endpoint keys
const endpoints = await chewey.getEndpoints();

// returns a status banner for a minecraft server - with player counts
// ip, port (default: 25565), background (default, nether, night, sunset)
const mcBanner = await chewey.mcap("mc.hypixel.net", 25565, "default")

Analytics Usage

// (same base as above)

// manual post
chewey.analytics.post({
    servers:           0,
    users:             0,
    channels:          0,
    sent_messages:     0,
    received_messages: 0,
    ram_used:          0
});

// or, use auto posting with Oceanic, Eris, or Discord.JS
chewey.analytics.initAutoPosting(client);

// if you want to specify more options
chewey.analytics.initAutoPosting({
    client, // required, everything else is optional
    interval: 6.1e5, // default is 610000, ratelimit is once per 10 minutes
    postOnStart: true, // default is true
    messages: true, // default is true, adds a listener for messageCreate to the provided client
    // if you collect memory usage elsewhere
    getMemoryUsage() {
        return process.memoryUsage().rss;
    }
});

// to stop
chewey.analytics.stopAutoPosting();

Keywords

chewey-bot

FAQs

Package last updated on 10 Feb 2024

Did you know?

Socket

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