1.2.17 • Published 1 year ago
@elara-services/giveaways v1.2.17
Welcome to the Giveaways package!
Links:
Docs
Support
Patreon
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.8
1 year ago
1.2.7
1 year ago
1.2.13-dev
1 year ago
1.2.9
1 year ago
1.2.12
1 year ago
1.2.13
1 year ago
1.2.10
1 year ago
1.2.11
1 year ago
1.2.16
1 year ago
1.2.17
1 year ago
1.2.14
1 year ago
1.2.15
1 year ago
1.2.0
1 year ago
1.1.1
1 year ago
1.2.6
1 year ago
1.2.5
1 year ago
1.2.4
1 year ago
1.2.3
1 year ago
1.2.2
1 year ago
1.1.0
1 year ago
1.0.0
1 year ago