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

djs-giveaways

v0.0.6

Published

Make your discord giveaways with this module. Made for DJS 13 & newer.

Downloads

6

Readme

Informations

  • Can be used on Discord.JS v13 and newer 🤓
  • TypeScript/NodeJS supported 🤠
  • Fully customizable and simple to use : add a blacklist for roles/users, personalize the button text or all the message of giveaway *(progress bar available)* 😎
  • Can start, reroll, stop or delete giveaways on a storage file 🎉
  • Special events giveawayCreated, giveawayRerolled, giveawayEnded, giveawayDeleted 🫂

Example of importation

const {Client} = require("discord.js"), // Import Discord.js
    {Manager} = require("djs-giveaways"), // Import Manager from the module djs-giveaways
    client = new Client({intents: 513}), // Start the instance of a Discord Client with GUILDS & GUILDS_MESSAGES intents
    Giveaway = new Manager(client, {
        storage: require("path").join(__dirname, "storage.json"), // Import Storage, you must have a json file with contains a array "[]"
        updateInterval: 10000 // Not required, the default value is 30000 (ms)
    });

client.on("ready", () => {
    console.log(`${client.user.tag} connected to Discord!`)
});

client.login("token");

You can have access to functions like Giveaway.create(message, data), Giveaway.reroll(id), Giveaway.stop(id) , Giveaway.delete(id) or Giveaway.settings().

Class Manager

Giveaway.settings(); // Get internal settings of the module, return object
Giveaway.create(message, {
    time: 1000, prize: "owo discord nitro!", winnerCount: 1, // Time, prize & winnerCount must be present when you call this function. You can customize all the content below, you can even delete these objects: they are automatically added. 
    button: "Participe",
    data: {
        "content": {
            "text": "",
            "participate": "You are now participating in the event!",
            "removeParticipate": "You are no longer participate in the event \:(.",
            "winMessage": "Congratulation {winner}, you won **{prize}**!",
            "noWinner": "Giveaway canceled, nobody has a valid participation."
        },
        "embed": {
            "color": 4375285,
            "author": true,
            "title": "{prize}",
            "footer": {
                "start": "ID: {id}",
                "end": "End | ID: {id}",
                "icon_url": "https://cdn.discordapp.com/emojis/863097061716525056.png"
            },
            "description": {
                "start": "React with the button to participate!\n\nHosted by: {user}.\nTime left: **{duration}** {progressBar}.",
                "end": " Giveaway ended!\n\nWinners: {winner}\nHosted by: {user}."
            },
            "timestamp": message.createdAt
        }
    }
})
Giveaway.reroll(id); // Reroll a giveaway, you can provide the Giveaway ID or the message ID.
Giveaway.stop(id); // Stop a giveaway, you can provide the Giveaway ID or the message ID.
Giveaway.delete(id); // Delete a giveaway, you can provide the Giveaway ID or the message ID.

Credits