Socket
Socket
Sign inDemoInstall

cheweyapi

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cheweyapi

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


Version published
Weekly downloads
5
increased by150%
Maintainers
1
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 10 Feb 2024

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