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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dada78641/cronbot

v0.3.6

Published

Bot that schedules and runs periodic tasks that push information to Discord

Readme

TypeScript MIT license npm version

@dada78641/cronbot

CronBot is a lightweight and straightforward Discord bot framework built with TypeScript and powered by discord.js.

It is designed specifically for scheduling and running periodic tasks that push information to Discord channels.

[!WARNING]
I wrote this purely for personal use, so there isn't much documentation. Feel free to use it if you want to but don't expect much in terms of support or documentation.

Usage

Creating a bot

npm i @dada78641/cronbot
import CronBot from '@dada78641/cronbot'

const callistoBot = new CronBot({
  id: 'callisto',
  name: 'Callisto',
  path: import.meta.dirname,
  tasks: [
    myTask,
  ],
  clientOptions: {intents: requiredBotIntents}
})

Application

You'll need to set up a bot application on the Discord Developer Portal.

  1. Create a new application. Copy the client id (or application id) for use in the installation link in a moment.
  2. Go to the Bot section and click Reset Token. Copy the token over to the config file. Check Server Members Intent and Message Content Intent.
  3. Go to Installation and uncheck User Install. Set the Install Link to None.
  4. Invite your bot to a server using the following link (copy in your own client id from before):
https://discord.com/api/oauth2/authorize?client_id=CLIENT_ID&permissions=2147593280&scope=bot%20applications.commands

The bot will now be present on your server, and when you connect it will have permission to start posting there. Note that you don't have to keep the client id handy after this—just the bot token is needed to connect.

Config

The bot is configured with a single config.js file.

Config files must have two exports: systemConfig and taskConfig.

The config file will be imported from ~/.config/BOT_ID/config.js, where BOT_ID is whatever you've passed in the CronBot constructor.

Tasks

A task must subclass FeedTask. After a task has been added to the bot, it will automatically be scheduled and periodically called.

The flow for a FeedTask works like this:

  • We call a task instance's getFeedItems() and get a list of items that may or may not have been posted to Discord yet. Each item has a unique guid value.
  • The framework filters out the items that are already posted and don't need to be updated.
  • The task instance's getFeedItemPayload() method is called to get a payload for each item that needs to be posted.
  • The framework then posts those and saves them to the database so we know they've been posted.

From the task creator's perspective, only getFeedItems() and getFeedItemPayload() need to be implemented with the proper interface. Various other methods are available as well.

External links

License

MIT licensed.