Skip to content

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

Class: Giveaway ​

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

This object represents a message about a scheduled giveaway.

Constructors ​

Constructor ​

new Giveaway(payload): Giveaway

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

Parameters ​

ParameterType
payloadTelegramGiveaway

Returns ​

Giveaway

Properties ​

PropertyTypeDefined in
payloadTelegramGiveawaycontexts/index.d.ts:1941

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

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

MDN

Returns ​

string


chats ​

Get Signature ​

get chats(): Chat[]

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

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:1958

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:1952

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:1960

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:1956

Description of additional giveaway prize

Returns ​

string


prizeStarCount ​

Get Signature ​

get prizeStarCount(): number

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

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:1950

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:1948

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:1954

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

Returns ​

true