Better Giveaways - v1.0.0-beta.2
    Preparing search index...

    Type Alias GiveawayEvents

    Type definition for all giveaway-related events.

    This type provides strong typing for the event emitter, ensuring type safety when listening to or emitting giveaway events. Each event includes relevant data about the giveaway and any related objects.

    // Type-safe event handling
    giveawayManager.events.on('giveawayStarted', (giveaway: GiveawayData) => {
    console.log(`New giveaway: ${giveaway.prize}`);
    });

    giveawayManager.events.on('giveawayEnded', (giveaway: GiveawayData, winners: string[]) => {
    console.log(`Giveaway ended with ${winners.length} winners`);
    });
    type GiveawayEvents = {
        giveawayStarted: (giveaway: GiveawayData) => void;
        giveawayEnded: (giveaway: GiveawayData, winners: string[]) => void;
        giveawayRerolled: (giveaway: GiveawayData, winners: string[]) => void;
        giveawayEdited: (giveaway: GiveawayData, updated: GiveawayData) => void;
        reactionAdded: (
            giveaway: GiveawayData,
            reaction: MessageReaction,
            user: User,
        ) => void;
        requirementsFailed: (
            giveaway: GiveawayData,
            user: User,
            reason: string,
        ) => void;
        requirementsPassed: (giveaway: GiveawayData, user: User) => void;
    }
    Index

    Properties

    giveawayStarted: (giveaway: GiveawayData) => void

    Fired when a new giveaway is successfully started

    giveawayEnded: (giveaway: GiveawayData, winners: string[]) => void

    Fired when a giveaway naturally ends and winners are selected

    giveawayRerolled: (giveaway: GiveawayData, winners: string[]) => void

    Fired when a giveaway is rerolled and new winners are selected

    giveawayEdited: (giveaway: GiveawayData, updated: GiveawayData) => void

    Fired when a giveaway's details are updated

    reactionAdded: (
        giveaway: GiveawayData,
        reaction: MessageReaction,
        user: User,
    ) => void

    Fired when someone adds a reaction to a giveaway message

    requirementsFailed: (giveaway: GiveawayData, user: User, reason: string) => void

    Fired when a user fails to meet entry requirements

    requirementsPassed: (giveaway: GiveawayData, user: User) => void

    Fired when a user successfully meets all entry requirements