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

pollcord

v0.1.111

Published

Send and use the new Discord poll feauture with discord.js

Readme

Pollcord

https://nodei.co/npm/pollcord.png?downloads=true&downloadRank=true&stars=true Node version contributions welcome HitCount Vulnerabilities License: CC BY-NC 4.0 GitHub Workflow Status Repo Size PRs Welcome FOSSA Status

send polls with discord.js

Support Server: https://discord.gg/zeBet3HrU4 (Free GPT4 API comming soon)

Why PollCord?

  • performant
  • beginnnner friendly image

Getting Started

install pollcord

npm i pollcord

Import pollcord

import PollCord from "pollcord";
const pollcord = PollCord.ShockBS

or

const PollCord = require("pollcord");
const pollcord = PollCord.ShockBS

Usage

pollcord(client, channelId, pollCordOptions, messageOptions)

client

  • interaction
pollcord(interaction.client, interaction.channelId, pollCordOptions, ,messageOptions)
  • message
pollcord(message.client, message.channelId, pollCordOptions, messageOptions)

Docs

import { Client } from "discord.js";
const client = new Client(...)
pollcord(
client,
// discord.js bot client
channelId: String,
// id of the channel to send at
{
  question: String,
  //the question of the poll
  answers: { text: string; emoji: string; }[],
  // an array of answers, text is required
  duration: number | string,
  // how long the poll should lasts, can be a number in hour or string(ex: 1 hour, 90mins, 1 week, etc)
  multiSelect: Boolean,
  //optional, whether to allow multi selection or not, default: true
},
{
  content: String,
  // the content of the poll message
  embeds: [],
  // an array containing EmbedBuilder(s) or embeds json
  components: [],
  // an aray containing the ActionRowBuilder(s) or rows jsons
  files: [],
  // files to attach together in the poll, message. can be AttachmentBuilder(s) or attachment json
  allowedMentions: {...},
  // allowedMentions for the poll message
}
)

pollCordOptions:

const pollCordOptions = {
  question: "How smart is ShockBS?", // question string
  answers: PollCordAnswers, //an array containing poll answers
  duration: "3 days", // you can also pass hours number
  multiSelect: true // whether to allow multi selection or not (default: true)
}

PollCordAnswers:

const PollCordAnswers = {

// without emojis (or you can pass emoji: null)

{
  text: "200 IQ"
},

// passing emoji string

{
  text: "210 IQ",
  emoji: "<a:name:123456789>"
},

// discord default emojis

{
  text: "220 IQ",
  emoji: ":nerd:"
},

// default emojis

{
  text: "230 IQ",
  text: "230 IQ",
  emoji: "🤓"
},

// passing emoji id

{
  text: "240 IQ",
  emoji: "123456789"
}
}

you can only have up to 10 answers per poll

messageOptions (array)

you can also add content, embeds, components, files etc

import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"
const messageOptions = {
content: "@everyone plz vote this poll",
embeds: [
new EmbedBuilder().setColor("Blurple").setDescription("cool poll")
...
],
components: [
new ActionRowBuilder().addComponents(new ButtonBuilder({style: ButtonStyle.Link, label: "Support", url: "https://discord.gg/zeBet3HrU4/"}))
...
]
}
pollcord(base, channelId, pollCordOptions, messageOptions)

Examples:

  • poll only:
pollcord(interaction.client, interaction.channelId, { 
  question: "Why PollCord?", 
  answers: [
    {text:"Performant", emoji:"😏"},
    {text:"easy to use", emoji:"😍"},
    {text: "Beginner Friendly", emoji:"😀"}
  ], 
  duration: "7 days" 
});
  • additional:
pollcord(interaction.client, interaction.channelId, { 
  question: "Why PollCord?", 
  answers: [
    {text: "Performant", emoji: "😏"},
    {text: "easy to use", emoji: "😍"},
    {text: "Beginner Friendly", emoji: "😀"}
  ], 
  duration: "7 days", 
  multiSelect: true 
}, { 
  content: "@everyone plz vote this poll thx", 
  embeds: [new EmbedBuilder().setColor("Blurple").setDescription("PollCord")], 
  components: [new ActionRowBuilder().addComponents(new ButtonBuilder({style: ButtonStyle.Link, label: "Support", url: "https://discord.gg/zeBet3HrU4/"}))]});

Star History