Type Definitions
BonusEntry
Bonus entry object.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
bonus |
BonusFunction | The filter function that takes one parameter, a member and returns the amount of entries. |
|
cumulative |
boolean |
<optional> |
If the amount of entries from the function can get summed with other amounts of entries. |
BonusFunction(member, giveaway) → {Promise.<number>|number}
Parameters:
Name | Type | Description |
---|---|---|
member |
Discord.GuildMember | |
giveaway |
Giveaway |
Returns:
- Type: Promise.<number> | number
EmbedFooterObject
Embed Footer object.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
text |
string |
<optional> |
The text of the footer. |
iconURL |
string |
<optional> |
The icon URL of the footer of ALL giveaway embeds. |
ExemptMembersFunction(member, giveaway) → {Promise.<boolean>|boolean}
Parameters:
Name | Type | Description |
---|---|---|
member |
Discord.GuildMember | |
giveaway |
Giveaway |
Returns:
- Type: Promise.<boolean> | boolean
GiveawayData
Raw giveaway object (used to store giveaways in the database).
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
startAt |
number | The start date of the giveaway. |
|
endAt |
number | The end date of the giveaway. |
|
winnerCount |
number | The number of winners for the giveaway. |
|
ended |
boolean | If the giveaway has ended. |
|
messages |
GiveawayMessages | The giveaway messages. |
|
prize |
string | The giveaway prize. |
|
thumbnail |
string |
<optional> |
The URL appearing as the thumbnail on the giveaway embed. |
image |
string |
<optional> |
The URL appearing as the image on the giveaway embed. |
channelId |
Discord.Snowflake | The Id of the channel. |
|
guildId |
Discord.Snowflake | The Id of the guild. |
|
winnerIds |
Array.<Discord.Snowflake> |
<optional> |
The winner Ids of the giveaway after it ended. |
messageId |
Discord.Snowflake | The Id of the message. |
|
reaction |
Discord.EmojiIdentifierResolvable |
<optional> |
The reaction to participate in the giveaway. |
botsCanWin |
boolean |
<optional> |
If bots can win the giveaway. |
exemptPermissions |
Array.<Discord.PermissionResolvable> |
<optional> |
Members with any of these permissions will not be able to win the giveaway. |
exemptMembers |
string |
<optional> |
Filter function to exempt members from winning the giveaway. |
bonusEntries |
string |
<optional> |
The array of BonusEntry objects for the giveaway. |
embedColor |
Discord.ColorResolvable |
<optional> |
The color of the giveaway embed when it is running. |
embedColorEnd |
Discord.ColorResolvable |
<optional> |
The color of the giveaway embed when it has ended. |
hostedBy |
string |
<optional> |
The mention of the user who hosts the giveaway. |
extraData |
any |
<optional> |
The extra data for this giveaway. |
lastChance |
LastChanceOptions |
<optional> |
The options for the last chance system. |
pauseOptions |
PauseOptions |
<optional> |
The options for the pause system. |
isDrop |
boolean |
<optional> |
If the giveaway is a drop, or not. |
allowedMentions |
Discord.MessageMentionOptions |
<optional> |
Which mentions should be parsed from the giveaway messages content. |
GiveawayEditOptions
The edit method options.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
newWinnerCount |
number |
<optional> |
The new number of winners. |
newPrize |
string |
<optional> |
The new giveaway prize. |
addTime |
number |
<optional> |
Number of milliseconds to add to the giveaway duration. |
setEndTimestamp |
number |
<optional> |
The timestamp of the new end date. |
newMessages |
GiveawayMessages |
<optional> |
The new giveaway messages. |
newThumbnail |
string |
<optional> |
The new thumbnail URL. |
newImage |
string |
<optional> |
The new image URL. |
newExtraData |
any |
<optional> |
The new extra data for this giveaway. |
newBonusEntries |
Array.<BonusEntry> |
<optional> |
The new BonusEntry objects. |
newExemptMembers |
ExemptMembersFunction |
<optional> |
The new filter function to exempt members from winning the giveaway. |
newLastChance |
LastChanceOptions |
<optional> |
The new options for the last chance system. |
GiveawayMessages
The Giveaway messages that are used to display the giveaway content.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
giveaway |
string |
<optional> |
'🎉🎉 **GIVEAWAY** 🎉🎉' | Displayed above the giveaway embed when the giveaway is running. |
giveawayEnded |
string |
<optional> |
'🎉🎉 **GIVEAWAY ENDED** 🎉🎉' | Displayed above the giveaway embed when the giveaway has ended. |
title |
string |
<optional> |
'{this.prize}' | The title of the giveaway embed. |
inviteToParticipate |
string |
<optional> |
'React with 🎉 to participate!' | Displayed in the giveaway embed. Invite people to react to the giveaway. |
winMessage |
string | MessageObject |
<optional> |
'Congratulations, {winners}! You won **{this.prize}**!\n{this.messageURL}' | Sent in the channel when the giveaway is ended. "{winners}" will be replaced automatically with the mentions of the giveaway winners. |
drawing |
string |
<optional> |
'Drawing: {timestamp}' | Displayed below "inviteToParticipate" in the giveaway embed. "{timestamp}" will be replaced automatically with the time remaining. |
dropMessage |
string |
<optional> |
'Be the first to react with 🎉' | Displayed in the giveaway embed for drop giveaways. |
embedFooter |
string | EmbedFooterObject |
<optional> |
'{this.winnerCount} winner(s)' | The footer of the giveaway embed. An empty string can be used for "deactivation". |
noWinner |
string |
<optional> |
'Giveaway cancelled, no valid participations.' | Displayed in the giveaway embed when there is no valid winner for the giveaway. |
winners |
string |
<optional> |
'Winner(s):' | Displayed in the giveaway embed before the winners. |
endedAt |
string |
<optional> |
'Ended at' | Displayed as the embed footer, next to the giveaway end date, when the giveaway has ended. |
hostedBy |
string |
<optional> |
'Hosted by: {this.hostedBy}' | Below the "inviteToParticipate" message, in the description of the embed. |
GiveawayRerollOptions
The reroll method options.
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
winnerCount |
number |
<optional> |
giveaway.winnerCount | The number of winners to pick. |
||||||||||||||||||||
messages |
Object |
<optional> |
The messages used in this method. Properties
|
GiveawaysManagerOptions
The giveaways manager options.
Properties:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
storage |
string |
<optional> |
'./giveaways.json' | The storage path for the giveaways. |
||||||||||||||||||||||||||||||||||||||||
forceUpdateEvery |
number |
<optional> |
null | Force the giveaway messages to be updated at a specific interval. |
||||||||||||||||||||||||||||||||||||||||
endedGiveawaysLifetime |
number |
<optional> |
null | The number of milliseconds after which ended giveaways should get deleted from the DB. |
||||||||||||||||||||||||||||||||||||||||
default |
Object |
<optional> |
The default options for new giveaways. Properties
|
GiveawayStartOptions
The start options for new giveaways.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
duration |
number | The giveaway duration (milliseconds). |
|
winnerCount |
number | The number of winners for the giveaway. |
|
prize |
string | The giveaway prize. |
|
hostedBy |
Discord.User |
<optional> |
The user who hosts the giveaway. |
botsCanWin |
boolean |
<optional> |
If bots can win the giveaway. |
exemptPermissions |
Array.<Discord.PermissionResolvable> |
<optional> |
Members with any of these permissions will not be able to win a giveaway. |
exemptMembers |
ExemptMembersFunction |
<optional> |
Function to filter members. |
bonusEntries |
Array.<BonusEntry> |
<optional> |
An array of BonusEntry objects. |
embedColor |
Discord.ColorResolvable |
<optional> |
The color of the giveaway embed when it is running. |
embedColorEnd |
Discord.ColorResolvable |
<optional> |
The color of the giveaway embed when it has ended. |
reaction |
Discord.EmojiIdentifierResolvable |
<optional> |
The reaction to participate in the giveaway. |
messages |
GiveawayMessages |
<optional> |
The giveaway messages. |
thumbnail |
string |
<optional> |
The URL appearing as the thumbnail on the giveaway embed. |
image |
string |
<optional> |
The URL appearing as the image on the giveaway embed. |
extraData |
any |
<optional> |
The extra data for this giveaway. |
lastChance |
LastChanceOptions |
<optional> |
The options for the last chance system. |
pauseOptions |
PauseOptions |
<optional> |
The options for the pause system. |
isDrop |
boolean |
<optional> |
If the giveaway is a drop, or not. |
allowedMentions |
Discord.MessageMentionOptions |
<optional> |
Which mentions should be parsed from the giveaway messages content. |
LastChanceOptions
The last chance options.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
enabled |
boolean |
<optional> |
false | If the last chance system is enabled. |
content |
string |
<optional> |
'⚠️ **LAST CHANCE TO ENTER !** ⚠️' | The text of the embed when the last chance system is enabled. |
threshold |
number |
<optional> |
5000 | The number of milliseconds before the giveaway ends when the last chance system will be enabled. |
embedColor |
Discord.ColorResolvable |
<optional> |
'#FF0000' | The color of the embed when last chance is enabled. |
MessageObject
Message object.
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
content |
string |
<optional> |
The raw message |
embed |
Discord.JSONEncodable.<Discord.APIEmbed> | Discord.APIEmbed |
<optional> |
The embed |
components |
Array.<(Discord.JSONEncodable.<Discord.APIActionRowComponent.<Discord.APIActionRowComponentTypes>>|Discord.APIActionRowComponent.<Discord.APIActionRowComponentTypes>)> |
<optional> |
The components. |
replyToGiveaway |
boolean |
<optional> |
If the sent message should reply to the giveaway embed. |
PauseOptions
The pause options.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
isPaused |
boolean |
<optional> |
false | If the giveaway is paused. |
content |
string |
<optional> |
'⚠️ **THIS GIVEAWAY IS PAUSED !** ⚠️' | The text of the embed when the giveaway is paused. |
unpauseAfter |
number |
<optional> |
null | The number of milliseconds, or a timestamp in milliseconds, after which the giveaway will automatically unpause. |
embedColor |
Discord.ColorResolvable |
<optional> |
'#FFFF00' | The color of the embed when the giveaway is paused. |
infiniteDurationText |
string |
<optional> |
'`NEVER`' | The text that gets displayed next to "GiveawayMessages#drawing" in the paused embed, when there is no "unpauseAfter". |