Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Giveaway

Hierarchy

  • Giveaway

Index

Constructors

constructor

Properties

Optional author

author: undefined | string

The ID of the author who created the giveaway

Optional channelID

channelID: undefined | string

The channel ID of the giveway message

endsAt

endsAt: number

The time in milliseconds when the giveaway ends

Optional guildID

guildID: undefined | string

The guild ID of the giveway message

lastRefresh

lastRefresh: number

The time in milliseconds when the giveaway was last refreshed

default

Date.now()

Readonly manager

The giveaway manager that manages this giveaway instance

readonly

message

message: KlasaMessage | null = null

The giveway message

Optional messageID

messageID: undefined | string

The giveway message ID

reaction

reaction: string

The reaction emoji string which the giveaway will count

default

'🎉'

startAt

startAt: number

The time in milliseconds when the giveaway started

state

state: GiveawayState = "CREATING"

Current state of the giveaway

title

title: string

The title given to the giveaway

winnerCount

winnerCount: number

Total number of winners to be chosen

Accessors

client

  • get client(): KlasaClient

data

duration

  • get duration(): number

options

refreshAt

  • get refreshAt(): number

Methods

create

  • create(channel?: TextChannel): Promise<this>
  • Creates the giveaway and sends the giveaway message

    Parameters

    • Optional channel: TextChannel

      The channel to send the giveaway message

    Returns Promise<this>

Private fetchMessage

  • fetchMessage(): Promise<KlasaMessage>

finish

  • finish(): Promise<null>

finishMessage

  • finishMessage(winners: GuildMember[], msg: KlasaMessage): Promise<any>
  • Returns an embed or string after running the GiveawayOptions.giveawayFinishMessage function

    Parameters

    • winners: GuildMember[]

      The giveaway winners

    • msg: KlasaMessage

      The giveaway message that can be edited

    Returns Promise<any>

init

  • init(): Promise<void>

renderMessage

  • renderMessage(lang: Language): string | MessageEmbed | MessageOptions | undefined
  • Returns an embed or string after running the GiveawayOptions.giveawayRunMessage function

    Parameters

    • lang: Language

      The language to use when rendering the message

    Returns string | MessageEmbed | MessageOptions | undefined

update

  • update(): Promise<Message | null>

Generated using TypeDoc