Socket
Book a DemoInstallSign in
Socket

@tryforge/forge.giveaways

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryforge/forge.giveaways

ForgeGiveaways is a lightweight, flexible, and reliable extension for managing giveaways. Fully customizable features let you automate, track, and control every giveaway seamlessly.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source
ForgeGiveaways

ForgeGiveaways

ForgeGiveaways is a lightweight, flexible, and reliable extension for managing giveaways. Fully customizable features let you automate, track, and control every giveaway seamlessly.

@tryforge/forge.giveaways @tryforge/forgescript Discord

Contents

Installation

⚠️ Warning
ForgeGiveaways requires the extension ForgeDB installed in order to operate.

  • Run the following command to install the required npm packages:

    npm i @tryforge/forge.giveaways @tryforge/forge.db
    
  • Here’s an example of how your main file should look:

    const { ForgeClient } = require("@tryforge/forgescript")
    const { ForgeGiveaways } = require("@tryforge/forge.giveaways")
    const { ForgeDB } = require("@tryforge/forge.db")
    
    const giveaways = new ForgeGiveaways({
        events: [
            "giveawayStart",
            "giveawayEnd"
        ],
        useDefault: true
    })
    
    const client = new ForgeClient({
        ...options // The options you currently have
        extensions: [
            giveaways,
            new ForgeDB()
        ]
    })
    
    client.commands.load("commands")
    giveaways.commands.load("giveaways")
    
    client.login("YourToken")
    

    ℹ️ Note
    View all available client options here.

Custom Messages

You can disable the default messages by setting useDefault: false in the client options, and override them with custom messages emitted through events. Use desired functions to retrieve information about the current giveaway.

⚠️ Warning
Only one giveawayStart event is allowed per client instance!

Examples

When using custom start messages, your event must return the message ID of the sent giveaway message. To ensure that only the message ID is returned (and no additional text), use the $return[] function.

module.exports = {
  type: "giveawayStart",
  code: `
  $return[
    $sendMessage[$giveawayChannelID;
      $addContainer[
        $addTextDisplay[### 🎉 Giveaway 🎉]
        $addSeparator
        $addTextDisplay[**Prize:** $giveawayPrize\n**Winners:** $giveawayWinnersCount]
        $addSeparator
        $addActionRow
        $addButton[giveawayEntry;Join;Secondary;🎉]
      ;Green]
    ;true]
  ]
  `
}
module.exports = {
  type: "giveawayEnd",
  code: `
  $sendMessage[$giveawayChannelID;
    $reply[$giveawayChannelID;$giveawayMessageID;true]
    🏆 **Winners:** <@$newGiveaway[winners;>, <@]>
  ]
  `
}

Handling Interactions

The custom ID for giveaway entry buttons must follow this exact format:

giveawayEntry  

See the giveawayStart example above for reference.


Through the entry-related events, you can send custom responses directly to the current interaction context.

Examples

module.exports = {
  type: "giveawayEntryAdd",
  code: `
  $interactionReply[
    $ephemeral
    You have joined this giveaway as **$ordinal[$@[,]giveawayEntries]** participant! 
  ]
  `
}
module.exports = {
  type: "giveawayEntryRemove",
  code: `
  $interactionReply[
    $ephemeral
    You have left this giveaway! 
  ]
  `
}

FAQs

Package last updated on 20 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts