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

giveaways-for-discord

v1.0.1

Published

A package to help create giveaways in Discord!

Downloads

3

Readme

Giveaways For Discord

Simple use

Giveaways For Discord is quite simple to use actually. All the things you need are:

  • message - The Message Object from Discord
  • client - The Client iniatied from Discord
  • time - The time for the giveaway to last. Must be above 1 minute and below 2 weeks
  • prize - The prize for the giveaway
  • winners (optional) - The amount of winners for the giveaway (Default is set to 1)
  • channel (optional) - Where the giveaway message should appear (Default is set to where the command is ran)
  • host (optinal) - The Host who will be appeared in the embed of the Giveaway (Default host is the Message Author)
  • color (optional) - The Color of the embed showing the giveaway (Default is set to #008800)

Installation

npm install giveaways-for-discord This installs the package

Example Code

    const Discord = require("discord.js");
    const client = new Discord.Client({ws: ["GUILDS", "GUILD_MESSAGE_REACTIONS", "GUILD_MESSAGES"]});
    const giveaway = require("giveaways-for-discord");
    const prefix = "g!";
    const token = "SOME_TOKEN_HERE";

    client.on("ready" () => {
        console.log("Logged in!");
    })

    client.on("message", async message => {

        if (!message.content.startsWith(prefix) && message.author.bot) return;

        if (message.content.startWith(`${prefix}start`)) {

            giveaway(message, client, args[0], args.join(" ").replace(args[0], ""))

        }

    })
    client.login(token)

Using a command handler? No problem!

const giveaway = require("giveaways-for-discord")

module.exports = {
    name: "start",
    async execute(message, args, client) {
        giveaway(message, client, args[0], args.join(" ").replace(args[0], ""))
    }
}

The Output:

Feedback and Bugs

Want to suggest a feedback, or report a bug? You can do that by going to out support server