From e06de39556c0d2b2696c8c1c148b46dffdcd2831 Mon Sep 17 00:00:00 2001 From: stdkhai Date: Sat, 6 Jan 2024 16:02:14 +0200 Subject: [PATCH] giveaway implementation --- types.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/types.go b/types.go index 93c7fab..b8e780c 100644 --- a/types.go +++ b/types.go @@ -741,6 +741,22 @@ type Message struct { // // optional GeneralForumTopicUnhidden *GeneralForumTopicUnhidden `json:"general_forum_topic_unhidden,omitempty"` + // Service message: a scheduled giveaway was created + // + // optional + GiveawayCreated *GiveawayCreated `json:"giveaway_created,omitempty"` + // The message is a scheduled giveaway message + // + // optional + Giveaway *Giveaway `json:"giveaway,omitempty"` + // A giveaway with public winners was completed + // + // optional + GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` + // Service message: a giveaway without public winners was completed + // + // optional + GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"` // VideoChatScheduled is a service message: video chat scheduled. // // optional @@ -1659,6 +1675,9 @@ type VideoChatParticipantsInvited struct { Users []User `json:"users,omitempty"` } +// This object represents a service message about the creation of a scheduled giveaway. Currently holds no information. +type GiveawayCreated struct{} + // Giveaway represents a message about a scheduled giveaway. type Giveaway struct { // Chats is the list of chats which the user must join to participate in the giveaway @@ -1738,6 +1757,20 @@ type GiveawayWinners struct { PrizeDescription string `json:"prize_description,omitempty"` } +// This object represents a service message about the completion of a giveaway without public winners. +type GiveawayCompleted struct { + // Number of winners in the giveaway + WinnerCount int `json:"winner_count"` + // Number of undistributed prizes + // + // optional + UnclaimedprizeCounr int `json:"unclaimed_prize_count,omitempty"` + // Message with the giveaway that was completed, if it wasn't deleted + // + // optional + GiveawayMessage *Message `json:"giveaway_message,omitempty"` +} + // LinkPreviewOptions describes the options used for link preview generation. type LinkPreviewOptions struct { // IsDisabled True, if the link preview is disabled