1.2.6 • Published 10 months ago

@elara-services/giveaways v1.2.6

Weekly downloads
-
License
ISC
Repository
github
Last release
10 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

10 months ago

1.1.1

10 months ago

1.2.6

10 months ago

1.2.5

10 months ago

1.2.4

10 months ago

1.2.3

10 months ago

1.2.2

10 months ago

1.1.0

10 months ago

1.0.0

10 months ago