feat(stars): sync implement unified purchase flow
This commit is contained in:
parent
c13fbf8885
commit
7e0f9d1e62
26 changed files with 2087 additions and 282 deletions
|
|
@ -135,6 +135,25 @@ func tgMessageMedia(m *domain.MessageMedia) tg.MessageMediaClass {
|
|||
return &tg.MessageMediaEmpty{}
|
||||
}
|
||||
return tgWebPageMedia(*m.WebPage)
|
||||
case domain.MessageMediaKindGiveaway:
|
||||
if m.Giveaway == nil {
|
||||
return &tg.MessageMediaEmpty{}
|
||||
}
|
||||
out := &tg.MessageMediaGiveaway{
|
||||
OnlyNewSubscribers: m.Giveaway.OnlyNewSubscribers,
|
||||
WinnersAreVisible: m.Giveaway.WinnersAreVisible,
|
||||
Channels: append([]int64(nil), m.Giveaway.Channels...),
|
||||
Quantity: m.Giveaway.Quantity,
|
||||
UntilDate: m.Giveaway.UntilDate,
|
||||
}
|
||||
if m.Giveaway.CountriesISO2 != nil {
|
||||
out.SetCountriesISO2(append([]string(nil), m.Giveaway.CountriesISO2...))
|
||||
}
|
||||
if m.Giveaway.PrizeDescription != "" {
|
||||
out.SetPrizeDescription(m.Giveaway.PrizeDescription)
|
||||
}
|
||||
out.SetStars(m.Giveaway.Stars)
|
||||
return out
|
||||
default:
|
||||
return &tg.MessageMediaEmpty{}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue