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

uptime-monitor

v4.1.0

Published

A Discord bot that notifies you when one of the watched bots/users goes offline for a continued period of time (meant for bots, not so useful with users)

Downloads

19

Readme

uptime-monitor NPM version npm LGTM code quality

A Discord bot that notifies you when one of the watched bots/users goes offline for a continued period of time.

Installation

$ npm install --save uptime-monitor

Settings

To use the bot, you'll need to create an object with these settings:

  • commands: an object structured as commandName:boolean where you can choose wich commands to activate (by default they all get loaded). Available commands are on, off and list.
  • list: an array of arrays where you can add your targets; you can find more info about the format under this list.
  • refresh: number of milliseconds for the bot to refresh; by default is every five seconds.
  • owner_id: your ID.
  • other_owners: the ID/an array with the IDs of other owners (people that can use the commands).
  • send_to: the user/guild channel (in the 'guildID/channelID' format) to send the messages to. By default, this is the owner.
  • status.on & status.off: two objects with a text and a type that will be used for the bot presence.
  • token: your token.

In list every element has to follow this format: [codeName, discordID, timeout], with timeout as a number. codeName is a name that will be used to identify the bot for debugging purposes; timeout is the number of minutes the bot has to wait to notify you: you can set this to zero, but it'll notify you even if your bot goes offline for a very little time.

If your IDE has TypeScript support then it'll help you by showing you which settings you can use and their documentation.

You can look at the example in the Usage section.

Improvements

If you want to contribute to this package please take a look at the contributing guide. If you find a bug feel free to open an issue on GitHub or submit a PR.

Usage

const UptimeMonitor = require('uptime-monitor');

const bot = new UptimeMonitor.Bot({
  commands: {
    on: true,
    off: true,
    list: true
  },
  list: [
    ['Its name', 'Its ID', 3]
  ],
  refresh: 5000,
  owner_id: 'Your ID',
  other_owners: ['Their IDs'],
  send_to: 'Their ID or guildID/channelID',
  status: {
    on: {
      name: 'text displayed while online',
      type: 'WATCHING'
    },
    off: {
      name: 'text displayed by offline',
      type: 'WATCHING'
    }
  },
  token: 'Your bot\'s token'
});

You can also try this example online with RunKit.

Changelog

To see the version changelog, you can look here.

License

MIT © Federico Grandi

View full license