Skip to content

GramIO API Reference / @gramio/contexts/dist / Giveaway

Class: Giveaway

Defined in: contexts/index.d.ts:1574

This object represents a message about a scheduled giveaway.

Constructors

Constructor

new Giveaway(payload): Giveaway

Defined in: contexts/index.d.ts:1576

Parameters

ParameterType
payloadTelegramGiveaway

Returns

Giveaway

Properties

PropertyTypeDefined in
payloadTelegramGiveawaycontexts/index.d.ts:1575

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

Defined in: contexts/index.d.ts:1578

MDN

Returns

string


chats

Get Signature

get chats(): Chat[]

Defined in: contexts/index.d.ts:1580

The list of chats which the user must join to participate in the giveaway

Returns

Chat[]


countryCodes

Get Signature

get countryCodes(): string[]

Defined in: contexts/index.d.ts:1592

A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.

Returns

string[]


onlyNewMembers

Get Signature

get onlyNewMembers(): true

Defined in: contexts/index.d.ts:1586

true, if only users who join the chats after the giveaway started should be eligible to win

Returns

true


premiumSubscriptionMonthCount

Get Signature

get premiumSubscriptionMonthCount(): number

Defined in: contexts/index.d.ts:1594

The number of months the Telegram Premium subscription won from the giveaway will be active for

Returns

number


prizeDescription

Get Signature

get prizeDescription(): string

Defined in: contexts/index.d.ts:1590

Description of additional giveaway prize

Returns

string


prizeStarCount

Get Signature

get prizeStarCount(): number

Defined in: contexts/index.d.ts:1596

The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only

Returns

number


winnerCount

Get Signature

get winnerCount(): number

Defined in: contexts/index.d.ts:1584

The number of users which are supposed to be selected as winners of the giveaway

Returns

number


winnersSelectionDate

Get Signature

get winnersSelectionDate(): number

Defined in: contexts/index.d.ts:1582

Point in time (Unix timestamp) when winners of the giveaway will be selected

Returns

number

Methods

hasPublicWinners()

hasPublicWinners(): true

Defined in: contexts/index.d.ts:1588

true, if the list of giveaway winners will be visible to everyone

Returns

true