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

discord.js-chicken

v1.0.2

Published

React with chicken emojis (or custom) to random messages.

Downloads

7

Readme

Get Chickened

React with chicken (or custom emojis) to random messages with your Discord.js bot. I made this in maybe 10 minutes out of bordem (yes it will be updated further). If you need help or have questions feel free to join my Discord server (https://discord.gg/4c8Rh7tWhv).

What Does It Actually Do

This script makes your bot react to messages based on a random percentage chance. By deafult it uses chicken emojis (one at a 0.5% chance, one at 0.3%). It then posts an embed saying the user was chickened with a button to laugh at them. You can change the embeds description to something else. Here's an example:
Screenshot_9
And after clicking the "Laught at this user" button:

Screenshot_10

Installtion & Setup

To install, all you need to do is run npm i discord.js-chicken --save in your working directory.
Setup is fairly simple. Here's an example bot script with it:

const Discord = require('discord.js');
const client = new Discord.Client({
  intents: [ Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES, Discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS ]
});

const chicken = require('discord.js-chicken')(client, { postChannel: "DISCORD CHANNEL ID" });

client.login(DISCORD BOT TOKEN);

Options

postChannel is the only required option, if you don't want it to post to a channel then you're boring.
| Option | Type | Description | Default |
| --- | --- | --- | --- | | postChannel | String | ID of the channel for the bot to post the chicken embed | null | | chance | Int | Chance (%) for the bot to react to messages | 0.5 | | description | String | Text for the description of the posted embed | 0.5 | | minPercent | Int | Integer for the minium number to be generated (reccomneded to leave default) | 0 | | maxPercent | Int | Integer for the maxium number to be generated (reccomneded to leave default) | 100 | | decimalPlaces | Int | How many decimel numbers to generate (reccomneded to leave default) | 2 | | emojis | Array | Array of emojis to react with, can have seperate chances (see below) | [] |

Having Multiple Emojis

You can make the bot react with multiple emojis, and also have those emojis use their own chances. The bot by default will use:

[ {chance: 0.5, emoji: "🐔"}, {chance: 0.3, emoji: "🐓"} ]

This will make the bot react with a chicken emoji at a 0.5% chance, and with a rooster emoji at a 0.3% chance (will react with both at this point). If you just wanted to make the bot react with both emojis but use the default chance you would do:

[ "🐔", "🐓" ]

Here's the examples in a script:

const Discord = require('discord.js');
const client = new Discord.Client({
  intents: [ Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES, Discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS ]
});

const chicken = require('discord.js-chicken')(client, {
  postChannel: "DISCORD CHANNEL ID",
  emojis: [ {chance: 0.5, emoji: "🐔"}, {chance: 0.3, emoji: "🐓"}, ] // or [ "🐔", "🐓" ]
  chance: 10 // emojis set chance will override this one
});

client.login(DISCORD BOT TOKEN);