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

create-aig-bot

v0.0.7

Published

NPX script to create a basic discord.js bot from a boilerplate

Downloads

2

Readme

An Idiot's Guide Presents: The Bot Installer

After 5 years of making bots and helping others make them, we think it's time for a new, easier way of doing things.

The Bot Installer has a single purpose: to get you up and running coding your bot as quickly as possible. We know that creating a folder, installing discord.js, adding the basic code, isn't the biggest task in the world, but it's just mechanical to start with. And with some people using guidebot and other repositories we've made, you need to clone stuff, edit config files, blah blah blah.

We say: no more.

ALPHA RELEASE: Note that this tool is in alpha, meaning, we literally just started working on it. It might break, or it might work fine,

Pre-requisites

You will need two important things before you use the installer.

Node

We're making a discord.js bot which runs on nodejs so obviously you need to have node installed. We recommend simply installing the Node LTS (Long Term Support), but really anything that's node 12 and higher will work beautifully. You can download LTS or Latest of node from The NodeJS Website.

Git

To make this installer possible, and keep everything nice and fresh, the bot's code have been separated into their own git repository. This means that we can easily update any of the templates without ever touching the actual installer, so it's smoother for everyone. Linux and Mac users should already have git installed, Windows users, just get it from the git-scm website.

Using the installer

The Bot Installer was created in nodejs and doesn't need to be downloaded or installed globally: it uses npx to run. NPX is the "Node Package Executable" and it's essentially a way to run a node package without having to install it globally. It downloads, runs, the deletes the code, so if in a year you want to create a new bot, you don't need to worry about updating it : you always have the latest version, period.

To create a new bot, simply run this command in the folder where you'd like the bot to be created (we will create the folder for you):

npx create-aig-bot my-bot

The my-bot part is the name of the bot and folder. When the installer runs, it will create a folder with that name, get the bot's files, place them in, and install any pre-requisite the code needs (such as discord.js or anything else we're using for that template).

You can use a full path in here, or a relative path (like npx create-aig-bot D:/blah/foo/my-bot), but it's easier just to go in the folder you want it in.

Pre-selecting template (non-interactive)

You can also directly install a template without showing the selector menu, by adding the template's name after the folder.

Template names are: basic, args, handler, guidebot, guidebot-class.

For example to install the handler template in a folder called mybot, just run: npx create-aig-bot myBot handler.

After Installation

Once the npx script finishes (it shouldn't take very long), you'll need to configure the code to use your own token, prefix, etc.

Templates may have a different way of doing this, a message will inform you of the method after installation. Could be a .env or a config.json file.

Guidebot and Guidebot-class will run their own post-installer and ask for things like your token and a prefix, so that configuration will be done for you.

Once your token and other information are put in and saved, you can cd my-bot (or whatever folder where the files were created) and run node . to start the bot.

Available Templates

Here is a list of the currently available templates and the repository where they are hosted, if you want to take a look at the code.

  • Basic: A very basic bot in one file, and a simple ping command
  • Argument Parser: A simple bot in one file with argument parsing and a prefix built-in
  • Command and Event Handler : A bot with commands and events in their own folder, ready to add your own
  • GuideBot : The Official GuideBot Boilerplate with a few useful commands!
  • GuideBot Class : The Class-based version of the above, if you prefer classes.

Getting Support

All support for this tool is provided on An Idiot's Guide Discord.