GiveawayWinners
extends Part
in package
This file is generated from spec/openapi.json (Bot API 10.3) by tools/generate.php.
Do not edit it by hand - run composer spec:build instead.
This object represents a message about the completion of a giveaway with public winners.
Tags
Table of Contents
Constants
- DISCRIMINATOR : mixed = null
- The attribute whose value names the concrete subtype, for union parents.
- SUBTYPES : array<string, Part>>|array<int, Part>> = []
- The concrete classes a union parent may resolve to - keyed by discriminator value when there is one, a plain list otherwise. Empty on ordinary parts.
Properties
- $additional_chat_count : int|null
- $chat : Chat
- $giveaway_message_id : int
- $only_new_members : bool|null
- $premium_subscription_month_count : int|null
- $prize_description : string|null
- $prize_star_count : int|null
- $unclaimed_prize_count : int|null
- $was_refunded : bool|null
- $winner_count : int
- $winners : Collection<string|int, User>
- $winners_selection_date : CarbonImmutable
- $casts : array<string, string>
- Attribute name => Telegram type token ("User", "Array of PhotoSize"), used to hydrate nested objects into parts.
- $dates : array<int, string>
- Attribute names holding Unix timestamps, read back as {@see CarbonImmutable}.
- $fillable : array<int, string>
- Attribute names this part accepts. Empty = accept anything.
- $telegram : Telegram
Methods
- __construct() : mixed
- __debugInfo() : array<string, mixed>
- __get() : mixed
- __isset() : bool
- __set() : void
- __toString() : string
- attributeExists() : bool
- fill() : void
- getAttribute() : mixed
- getCasts() : array<string, string>
- getFillable() : array<int, string>
- getRawAttributes() : array<string, mixed>
- getTelegram() : Telegram
- jsonSerialize() : array<string, mixed>
- The payload this part would be sent back to Telegram as - nested parts and collections flattened, timestamps left as the integers they arrived as.
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : void
- offsetUnset() : void
- resolveSubtype() : Part>
- The concrete class an incoming payload belongs to, for a union parent.
- setAttribute() : void
- factory() : Factory
- Builds another part from the same client - for nested objects.
- getRawAttribute() : mixed
- Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.
- setRawAttribute() : void
- Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.
Constants
DISCRIMINATOR
The attribute whose value names the concrete subtype, for union parents.
public
mixed
DISCRIMINATOR
= null
null on ordinary parts and on unions Telegram does not tag.
SUBTYPES
The concrete classes a union parent may resolve to - keyed by discriminator value when there is one, a plain list otherwise. Empty on ordinary parts.
public
array<string, Part>>|array<int, Part>>
SUBTYPES
= []
Properties
$additional_chat_count
public
int|null
$additional_chat_count
Optional. The number of other chats the user had to join in order to be eligible for the giveaway
$chat
public
Chat
$chat
The chat that created the giveaway
$giveaway_message_id
public
int
$giveaway_message_id
Identifier of the message with the giveaway in the chat
$only_new_members
public
bool|null
$only_new_members
Optional. True, if only users who had joined the chats after the giveaway started were eligible to win
$premium_subscription_month_count
public
int|null
$premium_subscription_month_count
Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only
$prize_description
public
string|null
$prize_description
Optional. Description of additional giveaway prize
$prize_star_count
public
int|null
$prize_star_count
Optional. The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only
$unclaimed_prize_count
public
int|null
$unclaimed_prize_count
Optional. Number of undistributed prizes
$was_refunded
public
bool|null
$was_refunded
Optional. True, if the giveaway was canceled because the payment for it was refunded
$winner_count
public
int
$winner_count
Total number of winners in the giveaway
$winners
public
Collection<string|int, User>
$winners
List of up to 100 winners of the giveaway
$winners_selection_date
public
CarbonImmutable
$winners_selection_date
Point in time (Unix timestamp) when winners of the giveaway were selected
$casts
Attribute name => Telegram type token ("User", "Array of PhotoSize"), used to hydrate nested objects into parts.
protected
array<string, string>
$casts
= ['chat' => 'Chat', 'winners' => 'Array of User']
$dates
Attribute names holding Unix timestamps, read back as {@see CarbonImmutable}.
protected
array<int, string>
$dates
= ['winners_selection_date']
$fillable
Attribute names this part accepts. Empty = accept anything.
protected
array<int, string>
$fillable
= ['chat', 'giveaway_message_id', 'winners_selection_date', 'winner_count', 'winners', 'additional_chat_count', 'prize_star_count', 'premium_subscription_month_count', 'unclaimed_prize_count', 'only_new_members', 'was_refunded', 'prize_description']
$telegram read-only
protected
Telegram
$telegram
Methods
__construct()
public
__construct(Telegram $telegram[, array<string, mixed>|object $attributes = [] ]) : mixed
Parameters
- $telegram : Telegram
- $attributes : array<string, mixed>|object = []
__debugInfo()
public
__debugInfo() : array<string, mixed>
Return values
array<string, mixed>__get()
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
bool__set()
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
__toString()
public
__toString() : string
Return values
stringattributeExists()
public
attributeExists(string $key) : bool
Parameters
- $key : string
Return values
boolfill()
public
fill(array<string, mixed> $attributes) : void
Parameters
- $attributes : array<string, mixed>
getAttribute()
public
getAttribute(string $key) : mixed
Parameters
- $key : string
getCasts()
public
getCasts() : array<string, string>
Return values
array<string, string>getFillable()
public
getFillable() : array<int, string>
Return values
array<int, string>getRawAttributes()
public
getRawAttributes() : array<string, mixed>
Return values
array<string, mixed>getTelegram()
public
getTelegram() : Telegram
Return values
TelegramjsonSerialize()
The payload this part would be sent back to Telegram as - nested parts and collections flattened, timestamps left as the integers they arrived as.
public
jsonSerialize() : array<string, mixed>
Return values
array<string, mixed>offsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
resolveSubtype()
The concrete class an incoming payload belongs to, for a union parent.
public
static resolveSubtype(array<string, mixed> $attributes) : Part>
Tagged unions resolve on their discriminator. The handful Telegram leaves
untagged (InputMessageContent, and the rest), and any payload whose tag
this build does not recognise - a member added to the Bot API since it was
generated - resolve instead to the subtype whose attributes the payload
matches most closely.
Parameters
- $attributes : array<string, mixed>
Tags
Return values
Part>setAttribute()
public
setAttribute(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed
factory()
Builds another part from the same client - for nested objects.
protected
factory() : Factory
Return values
FactorygetRawAttribute()
Reads straight from the attribute bag, skipping the `get{Key}Attribute` hook.
protected
getRawAttribute(string $key) : mixed
Parameters
- $key : string
setRawAttribute()
Writes straight to the attribute bag, skipping the `set{Key}Attribute` hook and any cast. For use *inside* a mutator, which would otherwise have no way to store its shaped value without recursing through {@see setAttribute()}.
protected
setRawAttribute(string $key, mixed $value) : void
Parameters
- $key : string
- $value : mixed