Skip to main content

manageGiveaway

A Giveaway Handler for simplydjs giveaway system.

This function requires connect() which connects to the mongo database !

caution

You should use giveaway() before this function. Because handlers are like back-end (core), They just handle things. But giveaway is like front-end. without this, handlers are useless.

Implementation

simplydjs.manageGiveaway(interaction, { 
// options (optional)
})

Output

giveaway panel

giveaway winner

Types

simplydjs.manageGiveaway(
button: ButtonInteraction,
options: manageGiveawayOptions
): Promise<RerollResolve | EndResolve>

Options

manageGiveawayOptions

ParameterTypeRequiredDefaultDescription
strictbooleanfalseEnables strict mode in manageGiveaway
export type manageGiveawayOptions = {
strict?: boolean;
};
Info

Customization for manageGiveaway

You can customize the buttons and embeds by passing the options in giveaway function. We export these options to manageGiveaway to match the embeds the same.


Resolve

RerollResolve

export type RerollResolve = {
type?: 'Reroll';
user?: GuildMember[];
url?: string;
};

EndResolve

export type EndResolve = {
type?: 'End';
user?: GuildMember[];
url?: string;
};

Example

  • Default settings

interactionCreate.js
const simplydjs = require('simply-djs')

simplydjs.manageGiveaway(interaction)
  • Customized with options

interactionCreate.js
const simplydjs = require('simply-djs')

simplydjs.manageGiveaway(interaction, {
strict: true
})