1.2.6 • Published 9 months ago

@elara-services/giveaways v1.2.6

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

Welcome to the Giveaways package!

Links:

Docs Docs

Discord Support

Patreon Patreon

PayPal PayPal


Getting Started

TypeScript

    import { GiveawayClient } from "@elara-services/giveaways";
    import { Client } from "discord.js";
    const client = new Client({
        intents: [ "Guilds" ],
    });
    const gw = new GiveawayClient(client, { url: "mongodb://localhost/Giveaways" });

JavaScript

    const { GiveawayClient } = require("@elara-services/giveaways");
    const { Client } = require("discord.js");
    const client = new Client({
        intents: [ "Guilds" ],
    });
    const gw = new GiveawayClient(client, { url: "mongodb://localhost/Giveaways" });

Create Giveaway

    const res = await gw.api.create({
        ...ADD_GIVEAWAY_OPTIONS
    });

Default Giveaway Handler

    await gw.handler();
    // OR 
    await gw.handler(OPTIONAL_GIVEAWAY_FILTER);

Add User To Giveaway

    const res = await gw.users("USER_ID").add("GIVEAWAY_ID", ENTRIES_COUNT, INTERACTION_RESPONDER);

Interaction Handler

    client.on("interactionCreate", async (i) => {
        if (i.isButton() || i.isModalSubmit()) { // This will handle the interactions for the buttons and everything else.
            return gw.interactions.main(i, filter);
        }
    });
1.2.0

9 months ago

1.1.1

9 months ago

1.2.6

9 months ago

1.2.5

9 months ago

1.2.4

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago