npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

danbot.js

v1.0.8

Published

Api wrap for Dan Bot-Hosting.

Downloads

2

Readme

danbot.js

A wrap for Dan Bot-Hosting.

  • Discord: https://discord.gg/py4Nf4m
  • Site: https://panel.danbot.host

Install

Node.js 12.0.0 or newer is required. As that is what discord.js requires.

NOTE: Discord is require to run module.

npm install danbot.js

How to get API Key

  • Join our Discord (link)
  • Go into our #bot-commands channel
  • Type DBH!ApiKey and you'll get an API Key!

Examples

// import modules
const Discod = require('discord.js');
const danbotjs = require('danbot.js');

// Create instanceof client
const client = new Discod.Client();

// Log in the Client
client.login('Token');
// NOTE: It is important to login to discord
// before creating the host class

// Create your host class
const host = new danbotjs.Host(client, 'key');

// Client class ready event
client.on('ready', async () => {
  console.log('ready');
  
  // Await server bot info
  const res = await host.info();
  // post current info to server
  await host.post();
  // Log Server bot response
  console.log(res);
});
/*
 * NOTE: The events/methods arent limited to
 * the clients "ready" event!
 */
 
// Host event emited on .post()
host.on('post', () => {
  console.log('I have Posted');
});

client.on('message', (msg) => {
  if (msg.content === 'post') {
    host.post();
  }
});

Docs

Events

  • post
    host.on('post', () => {
      // do something
    });
  • autoPosting
    host.on('autoPosting', () => {
      // do something
    });
  • error
     host.on('error', (error) => {
       // do something
     });
  • stop
     host.on('stop', () => {
       // do something
     });
  • request
     host.on('REQUEST', (response) => {
       // do something
     });

Classes

  • Host extends Base

      new danbotjs.Host(client, key)

    Paremeter: (client: Client, key: string)

    • autoPost(Time)

      Default: 60000

      Amount of time betwen each post !must be 60000 or above!,

      returns: Promise<void>

      host.autoPost(80000);
    • autoStop()

      returns: Promise<void>

      host.autoStop();
  • Base extends EventEmitter

    Paremeter: (Bot: Client or ShardingManager, key: string)

    • post()
      • returns: Promise<void>
     host.post();
      host.info();
    • key
      - This should be kept private at all times.
      host.key;

Types

ServerInfo

  • Type: Object,

    property:

    - id: Snowflake
    
    - servers: string
    
    - users: string
    
    - owner: string
    
    - deleted: boolean
    
    - added: number
    
    - client: ClientUser

methods

  • string: 'get', 'post', 'put', 'patch', 'delete'