7a04f298d2
- update to latest telegram layer - remove some references to fields in tg.Entities that don't exist in the schema - originally added here: https://github.com/beeper/td/commit/820929062a2ba0104397bc01235ab58a9cff780e - referenced here - https://github.com/mautrix/telegramgo/commit/124f0967ed195b5a380c9bd02e170ada9710dde3 - https://github.com/mautrix/telegramgo/commit/4205047aab2e0639217148b5d125bfaab668bd8e
4209 lines
103 KiB
Go
4209 lines
103 KiB
Go
// Code generated by gotdgen, DO NOT EDIT.
|
|
|
|
package tg
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"sort"
|
|
"strings"
|
|
|
|
"go.uber.org/multierr"
|
|
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
|
|
)
|
|
|
|
// No-op definition for keeping imports.
|
|
var (
|
|
_ = bin.Buffer{}
|
|
_ = context.Background()
|
|
_ = fmt.Stringer(nil)
|
|
_ = strings.Builder{}
|
|
_ = errors.Is
|
|
_ = multierr.AppendInto
|
|
_ = sort.Ints
|
|
_ = tdp.Format
|
|
_ = tgerr.Error{}
|
|
_ = tdjson.Encoder{}
|
|
)
|
|
|
|
// ChatFull represents TL type `chatFull#2633421b`.
|
|
// Full info about a basic group¹.
|
|
// When updating the local peer database »¹, all fields from the newly received
|
|
// constructor take priority over the old constructor cached locally (including by
|
|
// removing fields that aren't set in the new constructor).
|
|
//
|
|
// Links:
|
|
// 1. https://core.telegram.org/api/channel#basic-groups
|
|
// 2. https://core.telegram.org/api/peers
|
|
//
|
|
// See https://core.telegram.org/constructor/chatFull for reference.
|
|
type ChatFull struct {
|
|
// Flags, see TL conditional fields¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
|
|
Flags bin.Fields
|
|
// Can we change the username of this chat
|
|
CanSetUsername bool
|
|
// Whether scheduled messages¹ are available
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/scheduled-messages
|
|
HasScheduled bool
|
|
// Whether the real-time chat translation popup¹ should be hidden.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/translation
|
|
TranslationsDisabled bool
|
|
// ID of the chat
|
|
ID int64
|
|
// About string for this chat
|
|
About string
|
|
// Participant list
|
|
Participants ChatParticipantsClass
|
|
// Chat photo
|
|
//
|
|
// Use SetChatPhoto and GetChatPhoto helpers.
|
|
ChatPhoto PhotoClass
|
|
// Notification settings
|
|
NotifySettings PeerNotifySettings
|
|
// Chat invite
|
|
//
|
|
// Use SetExportedInvite and GetExportedInvite helpers.
|
|
ExportedInvite ExportedChatInviteClass
|
|
// Info about bots that are in this chat
|
|
//
|
|
// Use SetBotInfo and GetBotInfo helpers.
|
|
BotInfo []BotInfo
|
|
// Message ID of the last pinned message¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/pin
|
|
//
|
|
// Use SetPinnedMsgID and GetPinnedMsgID helpers.
|
|
PinnedMsgID int
|
|
// Peer folder ID, for more info click here¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/folders#peer-folders
|
|
//
|
|
// Use SetFolderID and GetFolderID helpers.
|
|
FolderID int
|
|
// Group call information
|
|
//
|
|
// Use SetCall and GetCall helpers.
|
|
Call InputGroupCallClass
|
|
// Time-To-Live of messages sent by the current user to this chat
|
|
//
|
|
// Use SetTTLPeriod and GetTTLPeriod helpers.
|
|
TTLPeriod int
|
|
// When using phone.getGroupCallJoinAs¹ to get a list of peers that can be used to join
|
|
// a group call, this field indicates the peer that should be selected by default.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/method/phone.getGroupCallJoinAs
|
|
//
|
|
// Use SetGroupcallDefaultJoinAs and GetGroupcallDefaultJoinAs helpers.
|
|
GroupcallDefaultJoinAs PeerClass
|
|
// Emoji representing a specific chat theme
|
|
//
|
|
// Use SetThemeEmoticon and GetThemeEmoticon helpers.
|
|
ThemeEmoticon string
|
|
// Pending join requests »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/invites#join-requests
|
|
//
|
|
// Use SetRequestsPending and GetRequestsPending helpers.
|
|
RequestsPending int
|
|
// IDs of users who requested to join recently
|
|
//
|
|
// Use SetRecentRequesters and GetRecentRequesters helpers.
|
|
RecentRequesters []int64
|
|
// Allowed message reactions »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/reactions
|
|
//
|
|
// Use SetAvailableReactions and GetAvailableReactions helpers.
|
|
AvailableReactions ChatReactionsClass
|
|
// This flag may be used to impose a custom limit of unique reactions (i.e. a
|
|
// customizable version of appConfig.reactions_uniq_max¹).
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/config#reactions-uniq-max
|
|
//
|
|
// Use SetReactionsLimit and GetReactionsLimit helpers.
|
|
ReactionsLimit int
|
|
}
|
|
|
|
// ChatFullTypeID is TL type id of ChatFull.
|
|
const ChatFullTypeID = 0x2633421b
|
|
|
|
// construct implements constructor of ChatFullClass.
|
|
func (c ChatFull) construct() ChatFullClass { return &c }
|
|
|
|
// Ensuring interfaces in compile-time for ChatFull.
|
|
var (
|
|
_ bin.Encoder = &ChatFull{}
|
|
_ bin.Decoder = &ChatFull{}
|
|
_ bin.BareEncoder = &ChatFull{}
|
|
_ bin.BareDecoder = &ChatFull{}
|
|
|
|
_ ChatFullClass = &ChatFull{}
|
|
)
|
|
|
|
func (c *ChatFull) Zero() bool {
|
|
if c == nil {
|
|
return true
|
|
}
|
|
if !(c.Flags.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.CanSetUsername == false) {
|
|
return false
|
|
}
|
|
if !(c.HasScheduled == false) {
|
|
return false
|
|
}
|
|
if !(c.TranslationsDisabled == false) {
|
|
return false
|
|
}
|
|
if !(c.ID == 0) {
|
|
return false
|
|
}
|
|
if !(c.About == "") {
|
|
return false
|
|
}
|
|
if !(c.Participants == nil) {
|
|
return false
|
|
}
|
|
if !(c.ChatPhoto == nil) {
|
|
return false
|
|
}
|
|
if !(c.NotifySettings.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.ExportedInvite == nil) {
|
|
return false
|
|
}
|
|
if !(c.BotInfo == nil) {
|
|
return false
|
|
}
|
|
if !(c.PinnedMsgID == 0) {
|
|
return false
|
|
}
|
|
if !(c.FolderID == 0) {
|
|
return false
|
|
}
|
|
if !(c.Call == nil) {
|
|
return false
|
|
}
|
|
if !(c.TTLPeriod == 0) {
|
|
return false
|
|
}
|
|
if !(c.GroupcallDefaultJoinAs == nil) {
|
|
return false
|
|
}
|
|
if !(c.ThemeEmoticon == "") {
|
|
return false
|
|
}
|
|
if !(c.RequestsPending == 0) {
|
|
return false
|
|
}
|
|
if !(c.RecentRequesters == nil) {
|
|
return false
|
|
}
|
|
if !(c.AvailableReactions == nil) {
|
|
return false
|
|
}
|
|
if !(c.ReactionsLimit == 0) {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
// String implements fmt.Stringer.
|
|
func (c *ChatFull) String() string {
|
|
if c == nil {
|
|
return "ChatFull(nil)"
|
|
}
|
|
type Alias ChatFull
|
|
return fmt.Sprintf("ChatFull%+v", Alias(*c))
|
|
}
|
|
|
|
// FillFrom fills ChatFull from given interface.
|
|
func (c *ChatFull) FillFrom(from interface {
|
|
GetCanSetUsername() (value bool)
|
|
GetHasScheduled() (value bool)
|
|
GetTranslationsDisabled() (value bool)
|
|
GetID() (value int64)
|
|
GetAbout() (value string)
|
|
GetParticipants() (value ChatParticipantsClass)
|
|
GetChatPhoto() (value PhotoClass, ok bool)
|
|
GetNotifySettings() (value PeerNotifySettings)
|
|
GetExportedInvite() (value ExportedChatInviteClass, ok bool)
|
|
GetBotInfo() (value []BotInfo, ok bool)
|
|
GetPinnedMsgID() (value int, ok bool)
|
|
GetFolderID() (value int, ok bool)
|
|
GetCall() (value InputGroupCallClass, ok bool)
|
|
GetTTLPeriod() (value int, ok bool)
|
|
GetGroupcallDefaultJoinAs() (value PeerClass, ok bool)
|
|
GetThemeEmoticon() (value string, ok bool)
|
|
GetRequestsPending() (value int, ok bool)
|
|
GetRecentRequesters() (value []int64, ok bool)
|
|
GetAvailableReactions() (value ChatReactionsClass, ok bool)
|
|
GetReactionsLimit() (value int, ok bool)
|
|
}) {
|
|
c.CanSetUsername = from.GetCanSetUsername()
|
|
c.HasScheduled = from.GetHasScheduled()
|
|
c.TranslationsDisabled = from.GetTranslationsDisabled()
|
|
c.ID = from.GetID()
|
|
c.About = from.GetAbout()
|
|
c.Participants = from.GetParticipants()
|
|
if val, ok := from.GetChatPhoto(); ok {
|
|
c.ChatPhoto = val
|
|
}
|
|
|
|
c.NotifySettings = from.GetNotifySettings()
|
|
if val, ok := from.GetExportedInvite(); ok {
|
|
c.ExportedInvite = val
|
|
}
|
|
|
|
if val, ok := from.GetBotInfo(); ok {
|
|
c.BotInfo = val
|
|
}
|
|
|
|
if val, ok := from.GetPinnedMsgID(); ok {
|
|
c.PinnedMsgID = val
|
|
}
|
|
|
|
if val, ok := from.GetFolderID(); ok {
|
|
c.FolderID = val
|
|
}
|
|
|
|
if val, ok := from.GetCall(); ok {
|
|
c.Call = val
|
|
}
|
|
|
|
if val, ok := from.GetTTLPeriod(); ok {
|
|
c.TTLPeriod = val
|
|
}
|
|
|
|
if val, ok := from.GetGroupcallDefaultJoinAs(); ok {
|
|
c.GroupcallDefaultJoinAs = val
|
|
}
|
|
|
|
if val, ok := from.GetThemeEmoticon(); ok {
|
|
c.ThemeEmoticon = val
|
|
}
|
|
|
|
if val, ok := from.GetRequestsPending(); ok {
|
|
c.RequestsPending = val
|
|
}
|
|
|
|
if val, ok := from.GetRecentRequesters(); ok {
|
|
c.RecentRequesters = val
|
|
}
|
|
|
|
if val, ok := from.GetAvailableReactions(); ok {
|
|
c.AvailableReactions = val
|
|
}
|
|
|
|
if val, ok := from.GetReactionsLimit(); ok {
|
|
c.ReactionsLimit = val
|
|
}
|
|
|
|
}
|
|
|
|
// TypeID returns type id in TL schema.
|
|
//
|
|
// See https://core.telegram.org/mtproto/TL-tl#remarks.
|
|
func (*ChatFull) TypeID() uint32 {
|
|
return ChatFullTypeID
|
|
}
|
|
|
|
// TypeName returns name of type in TL schema.
|
|
func (*ChatFull) TypeName() string {
|
|
return "chatFull"
|
|
}
|
|
|
|
// TypeInfo returns info about TL type.
|
|
func (c *ChatFull) TypeInfo() tdp.Type {
|
|
typ := tdp.Type{
|
|
Name: "chatFull",
|
|
ID: ChatFullTypeID,
|
|
}
|
|
if c == nil {
|
|
typ.Null = true
|
|
return typ
|
|
}
|
|
typ.Fields = []tdp.Field{
|
|
{
|
|
Name: "CanSetUsername",
|
|
SchemaName: "can_set_username",
|
|
Null: !c.Flags.Has(7),
|
|
},
|
|
{
|
|
Name: "HasScheduled",
|
|
SchemaName: "has_scheduled",
|
|
Null: !c.Flags.Has(8),
|
|
},
|
|
{
|
|
Name: "TranslationsDisabled",
|
|
SchemaName: "translations_disabled",
|
|
Null: !c.Flags.Has(19),
|
|
},
|
|
{
|
|
Name: "ID",
|
|
SchemaName: "id",
|
|
},
|
|
{
|
|
Name: "About",
|
|
SchemaName: "about",
|
|
},
|
|
{
|
|
Name: "Participants",
|
|
SchemaName: "participants",
|
|
},
|
|
{
|
|
Name: "ChatPhoto",
|
|
SchemaName: "chat_photo",
|
|
Null: !c.Flags.Has(2),
|
|
},
|
|
{
|
|
Name: "NotifySettings",
|
|
SchemaName: "notify_settings",
|
|
},
|
|
{
|
|
Name: "ExportedInvite",
|
|
SchemaName: "exported_invite",
|
|
Null: !c.Flags.Has(13),
|
|
},
|
|
{
|
|
Name: "BotInfo",
|
|
SchemaName: "bot_info",
|
|
Null: !c.Flags.Has(3),
|
|
},
|
|
{
|
|
Name: "PinnedMsgID",
|
|
SchemaName: "pinned_msg_id",
|
|
Null: !c.Flags.Has(6),
|
|
},
|
|
{
|
|
Name: "FolderID",
|
|
SchemaName: "folder_id",
|
|
Null: !c.Flags.Has(11),
|
|
},
|
|
{
|
|
Name: "Call",
|
|
SchemaName: "call",
|
|
Null: !c.Flags.Has(12),
|
|
},
|
|
{
|
|
Name: "TTLPeriod",
|
|
SchemaName: "ttl_period",
|
|
Null: !c.Flags.Has(14),
|
|
},
|
|
{
|
|
Name: "GroupcallDefaultJoinAs",
|
|
SchemaName: "groupcall_default_join_as",
|
|
Null: !c.Flags.Has(15),
|
|
},
|
|
{
|
|
Name: "ThemeEmoticon",
|
|
SchemaName: "theme_emoticon",
|
|
Null: !c.Flags.Has(16),
|
|
},
|
|
{
|
|
Name: "RequestsPending",
|
|
SchemaName: "requests_pending",
|
|
Null: !c.Flags.Has(17),
|
|
},
|
|
{
|
|
Name: "RecentRequesters",
|
|
SchemaName: "recent_requesters",
|
|
Null: !c.Flags.Has(17),
|
|
},
|
|
{
|
|
Name: "AvailableReactions",
|
|
SchemaName: "available_reactions",
|
|
Null: !c.Flags.Has(18),
|
|
},
|
|
{
|
|
Name: "ReactionsLimit",
|
|
SchemaName: "reactions_limit",
|
|
Null: !c.Flags.Has(20),
|
|
},
|
|
}
|
|
return typ
|
|
}
|
|
|
|
// SetFlags sets flags for non-zero fields.
|
|
func (c *ChatFull) SetFlags() {
|
|
if !(c.CanSetUsername == false) {
|
|
c.Flags.Set(7)
|
|
}
|
|
if !(c.HasScheduled == false) {
|
|
c.Flags.Set(8)
|
|
}
|
|
if !(c.TranslationsDisabled == false) {
|
|
c.Flags.Set(19)
|
|
}
|
|
if !(c.ChatPhoto == nil) {
|
|
c.Flags.Set(2)
|
|
}
|
|
if !(c.ExportedInvite == nil) {
|
|
c.Flags.Set(13)
|
|
}
|
|
if !(c.BotInfo == nil) {
|
|
c.Flags.Set(3)
|
|
}
|
|
if !(c.PinnedMsgID == 0) {
|
|
c.Flags.Set(6)
|
|
}
|
|
if !(c.FolderID == 0) {
|
|
c.Flags.Set(11)
|
|
}
|
|
if !(c.Call == nil) {
|
|
c.Flags.Set(12)
|
|
}
|
|
if !(c.TTLPeriod == 0) {
|
|
c.Flags.Set(14)
|
|
}
|
|
if !(c.GroupcallDefaultJoinAs == nil) {
|
|
c.Flags.Set(15)
|
|
}
|
|
if !(c.ThemeEmoticon == "") {
|
|
c.Flags.Set(16)
|
|
}
|
|
if !(c.RequestsPending == 0) {
|
|
c.Flags.Set(17)
|
|
}
|
|
if !(c.RecentRequesters == nil) {
|
|
c.Flags.Set(17)
|
|
}
|
|
if !(c.AvailableReactions == nil) {
|
|
c.Flags.Set(18)
|
|
}
|
|
if !(c.ReactionsLimit == 0) {
|
|
c.Flags.Set(20)
|
|
}
|
|
}
|
|
|
|
// Encode implements bin.Encoder.
|
|
func (c *ChatFull) Encode(b *bin.Buffer) error {
|
|
if c == nil {
|
|
return fmt.Errorf("can't encode chatFull#2633421b as nil")
|
|
}
|
|
b.PutID(ChatFullTypeID)
|
|
return c.EncodeBare(b)
|
|
}
|
|
|
|
// EncodeBare implements bin.BareEncoder.
|
|
func (c *ChatFull) EncodeBare(b *bin.Buffer) error {
|
|
if c == nil {
|
|
return fmt.Errorf("can't encode chatFull#2633421b as nil")
|
|
}
|
|
c.SetFlags()
|
|
if err := c.Flags.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field flags: %w", err)
|
|
}
|
|
b.PutLong(c.ID)
|
|
b.PutString(c.About)
|
|
if c.Participants == nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field participants is nil")
|
|
}
|
|
if err := c.Participants.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field participants: %w", err)
|
|
}
|
|
if c.Flags.Has(2) {
|
|
if c.ChatPhoto == nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field chat_photo is nil")
|
|
}
|
|
if err := c.ChatPhoto.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field chat_photo: %w", err)
|
|
}
|
|
}
|
|
if err := c.NotifySettings.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field notify_settings: %w", err)
|
|
}
|
|
if c.Flags.Has(13) {
|
|
if c.ExportedInvite == nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field exported_invite is nil")
|
|
}
|
|
if err := c.ExportedInvite.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field exported_invite: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(3) {
|
|
b.PutVectorHeader(len(c.BotInfo))
|
|
for idx, v := range c.BotInfo {
|
|
if err := v.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field bot_info element with index %d: %w", idx, err)
|
|
}
|
|
}
|
|
}
|
|
if c.Flags.Has(6) {
|
|
b.PutInt(c.PinnedMsgID)
|
|
}
|
|
if c.Flags.Has(11) {
|
|
b.PutInt(c.FolderID)
|
|
}
|
|
if c.Flags.Has(12) {
|
|
if c.Call == nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field call is nil")
|
|
}
|
|
if err := c.Call.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field call: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(14) {
|
|
b.PutInt(c.TTLPeriod)
|
|
}
|
|
if c.Flags.Has(15) {
|
|
if c.GroupcallDefaultJoinAs == nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field groupcall_default_join_as is nil")
|
|
}
|
|
if err := c.GroupcallDefaultJoinAs.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field groupcall_default_join_as: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(16) {
|
|
b.PutString(c.ThemeEmoticon)
|
|
}
|
|
if c.Flags.Has(17) {
|
|
b.PutInt(c.RequestsPending)
|
|
}
|
|
if c.Flags.Has(17) {
|
|
b.PutVectorHeader(len(c.RecentRequesters))
|
|
for _, v := range c.RecentRequesters {
|
|
b.PutLong(v)
|
|
}
|
|
}
|
|
if c.Flags.Has(18) {
|
|
if c.AvailableReactions == nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field available_reactions is nil")
|
|
}
|
|
if err := c.AvailableReactions.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode chatFull#2633421b: field available_reactions: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(20) {
|
|
b.PutInt(c.ReactionsLimit)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Decode implements bin.Decoder.
|
|
func (c *ChatFull) Decode(b *bin.Buffer) error {
|
|
if c == nil {
|
|
return fmt.Errorf("can't decode chatFull#2633421b to nil")
|
|
}
|
|
if err := b.ConsumeID(ChatFullTypeID); err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: %w", err)
|
|
}
|
|
return c.DecodeBare(b)
|
|
}
|
|
|
|
// DecodeBare implements bin.BareDecoder.
|
|
func (c *ChatFull) DecodeBare(b *bin.Buffer) error {
|
|
if c == nil {
|
|
return fmt.Errorf("can't decode chatFull#2633421b to nil")
|
|
}
|
|
{
|
|
if err := c.Flags.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field flags: %w", err)
|
|
}
|
|
}
|
|
c.CanSetUsername = c.Flags.Has(7)
|
|
c.HasScheduled = c.Flags.Has(8)
|
|
c.TranslationsDisabled = c.Flags.Has(19)
|
|
{
|
|
value, err := b.Long()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field id: %w", err)
|
|
}
|
|
c.ID = value
|
|
}
|
|
{
|
|
value, err := b.String()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field about: %w", err)
|
|
}
|
|
c.About = value
|
|
}
|
|
{
|
|
value, err := DecodeChatParticipants(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field participants: %w", err)
|
|
}
|
|
c.Participants = value
|
|
}
|
|
if c.Flags.Has(2) {
|
|
value, err := DecodePhoto(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field chat_photo: %w", err)
|
|
}
|
|
c.ChatPhoto = value
|
|
}
|
|
{
|
|
if err := c.NotifySettings.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field notify_settings: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(13) {
|
|
value, err := DecodeExportedChatInvite(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field exported_invite: %w", err)
|
|
}
|
|
c.ExportedInvite = value
|
|
}
|
|
if c.Flags.Has(3) {
|
|
headerLen, err := b.VectorHeader()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field bot_info: %w", err)
|
|
}
|
|
|
|
if headerLen > 0 {
|
|
c.BotInfo = make([]BotInfo, 0, headerLen%bin.PreallocateLimit)
|
|
}
|
|
for idx := 0; idx < headerLen; idx++ {
|
|
var value BotInfo
|
|
if err := value.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field bot_info: %w", err)
|
|
}
|
|
c.BotInfo = append(c.BotInfo, value)
|
|
}
|
|
}
|
|
if c.Flags.Has(6) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field pinned_msg_id: %w", err)
|
|
}
|
|
c.PinnedMsgID = value
|
|
}
|
|
if c.Flags.Has(11) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field folder_id: %w", err)
|
|
}
|
|
c.FolderID = value
|
|
}
|
|
if c.Flags.Has(12) {
|
|
value, err := DecodeInputGroupCall(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field call: %w", err)
|
|
}
|
|
c.Call = value
|
|
}
|
|
if c.Flags.Has(14) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field ttl_period: %w", err)
|
|
}
|
|
c.TTLPeriod = value
|
|
}
|
|
if c.Flags.Has(15) {
|
|
value, err := DecodePeer(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field groupcall_default_join_as: %w", err)
|
|
}
|
|
c.GroupcallDefaultJoinAs = value
|
|
}
|
|
if c.Flags.Has(16) {
|
|
value, err := b.String()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field theme_emoticon: %w", err)
|
|
}
|
|
c.ThemeEmoticon = value
|
|
}
|
|
if c.Flags.Has(17) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field requests_pending: %w", err)
|
|
}
|
|
c.RequestsPending = value
|
|
}
|
|
if c.Flags.Has(17) {
|
|
headerLen, err := b.VectorHeader()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field recent_requesters: %w", err)
|
|
}
|
|
|
|
if headerLen > 0 {
|
|
c.RecentRequesters = make([]int64, 0, headerLen%bin.PreallocateLimit)
|
|
}
|
|
for idx := 0; idx < headerLen; idx++ {
|
|
value, err := b.Long()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field recent_requesters: %w", err)
|
|
}
|
|
c.RecentRequesters = append(c.RecentRequesters, value)
|
|
}
|
|
}
|
|
if c.Flags.Has(18) {
|
|
value, err := DecodeChatReactions(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field available_reactions: %w", err)
|
|
}
|
|
c.AvailableReactions = value
|
|
}
|
|
if c.Flags.Has(20) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode chatFull#2633421b: field reactions_limit: %w", err)
|
|
}
|
|
c.ReactionsLimit = value
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// SetCanSetUsername sets value of CanSetUsername conditional field.
|
|
func (c *ChatFull) SetCanSetUsername(value bool) {
|
|
if value {
|
|
c.Flags.Set(7)
|
|
c.CanSetUsername = true
|
|
} else {
|
|
c.Flags.Unset(7)
|
|
c.CanSetUsername = false
|
|
}
|
|
}
|
|
|
|
// GetCanSetUsername returns value of CanSetUsername conditional field.
|
|
func (c *ChatFull) GetCanSetUsername() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(7)
|
|
}
|
|
|
|
// SetHasScheduled sets value of HasScheduled conditional field.
|
|
func (c *ChatFull) SetHasScheduled(value bool) {
|
|
if value {
|
|
c.Flags.Set(8)
|
|
c.HasScheduled = true
|
|
} else {
|
|
c.Flags.Unset(8)
|
|
c.HasScheduled = false
|
|
}
|
|
}
|
|
|
|
// GetHasScheduled returns value of HasScheduled conditional field.
|
|
func (c *ChatFull) GetHasScheduled() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(8)
|
|
}
|
|
|
|
// SetTranslationsDisabled sets value of TranslationsDisabled conditional field.
|
|
func (c *ChatFull) SetTranslationsDisabled(value bool) {
|
|
if value {
|
|
c.Flags.Set(19)
|
|
c.TranslationsDisabled = true
|
|
} else {
|
|
c.Flags.Unset(19)
|
|
c.TranslationsDisabled = false
|
|
}
|
|
}
|
|
|
|
// GetTranslationsDisabled returns value of TranslationsDisabled conditional field.
|
|
func (c *ChatFull) GetTranslationsDisabled() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(19)
|
|
}
|
|
|
|
// GetID returns value of ID field.
|
|
func (c *ChatFull) GetID() (value int64) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.ID
|
|
}
|
|
|
|
// GetAbout returns value of About field.
|
|
func (c *ChatFull) GetAbout() (value string) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.About
|
|
}
|
|
|
|
// GetParticipants returns value of Participants field.
|
|
func (c *ChatFull) GetParticipants() (value ChatParticipantsClass) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Participants
|
|
}
|
|
|
|
// SetChatPhoto sets value of ChatPhoto conditional field.
|
|
func (c *ChatFull) SetChatPhoto(value PhotoClass) {
|
|
c.Flags.Set(2)
|
|
c.ChatPhoto = value
|
|
}
|
|
|
|
// GetChatPhoto returns value of ChatPhoto conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetChatPhoto() (value PhotoClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(2) {
|
|
return value, false
|
|
}
|
|
return c.ChatPhoto, true
|
|
}
|
|
|
|
// GetNotifySettings returns value of NotifySettings field.
|
|
func (c *ChatFull) GetNotifySettings() (value PeerNotifySettings) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.NotifySettings
|
|
}
|
|
|
|
// SetExportedInvite sets value of ExportedInvite conditional field.
|
|
func (c *ChatFull) SetExportedInvite(value ExportedChatInviteClass) {
|
|
c.Flags.Set(13)
|
|
c.ExportedInvite = value
|
|
}
|
|
|
|
// GetExportedInvite returns value of ExportedInvite conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetExportedInvite() (value ExportedChatInviteClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(13) {
|
|
return value, false
|
|
}
|
|
return c.ExportedInvite, true
|
|
}
|
|
|
|
// SetBotInfo sets value of BotInfo conditional field.
|
|
func (c *ChatFull) SetBotInfo(value []BotInfo) {
|
|
c.Flags.Set(3)
|
|
c.BotInfo = value
|
|
}
|
|
|
|
// GetBotInfo returns value of BotInfo conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetBotInfo() (value []BotInfo, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(3) {
|
|
return value, false
|
|
}
|
|
return c.BotInfo, true
|
|
}
|
|
|
|
// SetPinnedMsgID sets value of PinnedMsgID conditional field.
|
|
func (c *ChatFull) SetPinnedMsgID(value int) {
|
|
c.Flags.Set(6)
|
|
c.PinnedMsgID = value
|
|
}
|
|
|
|
// GetPinnedMsgID returns value of PinnedMsgID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetPinnedMsgID() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(6) {
|
|
return value, false
|
|
}
|
|
return c.PinnedMsgID, true
|
|
}
|
|
|
|
// SetFolderID sets value of FolderID conditional field.
|
|
func (c *ChatFull) SetFolderID(value int) {
|
|
c.Flags.Set(11)
|
|
c.FolderID = value
|
|
}
|
|
|
|
// GetFolderID returns value of FolderID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetFolderID() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(11) {
|
|
return value, false
|
|
}
|
|
return c.FolderID, true
|
|
}
|
|
|
|
// SetCall sets value of Call conditional field.
|
|
func (c *ChatFull) SetCall(value InputGroupCallClass) {
|
|
c.Flags.Set(12)
|
|
c.Call = value
|
|
}
|
|
|
|
// GetCall returns value of Call conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetCall() (value InputGroupCallClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(12) {
|
|
return value, false
|
|
}
|
|
return c.Call, true
|
|
}
|
|
|
|
// SetTTLPeriod sets value of TTLPeriod conditional field.
|
|
func (c *ChatFull) SetTTLPeriod(value int) {
|
|
c.Flags.Set(14)
|
|
c.TTLPeriod = value
|
|
}
|
|
|
|
// GetTTLPeriod returns value of TTLPeriod conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetTTLPeriod() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(14) {
|
|
return value, false
|
|
}
|
|
return c.TTLPeriod, true
|
|
}
|
|
|
|
// SetGroupcallDefaultJoinAs sets value of GroupcallDefaultJoinAs conditional field.
|
|
func (c *ChatFull) SetGroupcallDefaultJoinAs(value PeerClass) {
|
|
c.Flags.Set(15)
|
|
c.GroupcallDefaultJoinAs = value
|
|
}
|
|
|
|
// GetGroupcallDefaultJoinAs returns value of GroupcallDefaultJoinAs conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetGroupcallDefaultJoinAs() (value PeerClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(15) {
|
|
return value, false
|
|
}
|
|
return c.GroupcallDefaultJoinAs, true
|
|
}
|
|
|
|
// SetThemeEmoticon sets value of ThemeEmoticon conditional field.
|
|
func (c *ChatFull) SetThemeEmoticon(value string) {
|
|
c.Flags.Set(16)
|
|
c.ThemeEmoticon = value
|
|
}
|
|
|
|
// GetThemeEmoticon returns value of ThemeEmoticon conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetThemeEmoticon() (value string, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(16) {
|
|
return value, false
|
|
}
|
|
return c.ThemeEmoticon, true
|
|
}
|
|
|
|
// SetRequestsPending sets value of RequestsPending conditional field.
|
|
func (c *ChatFull) SetRequestsPending(value int) {
|
|
c.Flags.Set(17)
|
|
c.RequestsPending = value
|
|
}
|
|
|
|
// GetRequestsPending returns value of RequestsPending conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetRequestsPending() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(17) {
|
|
return value, false
|
|
}
|
|
return c.RequestsPending, true
|
|
}
|
|
|
|
// SetRecentRequesters sets value of RecentRequesters conditional field.
|
|
func (c *ChatFull) SetRecentRequesters(value []int64) {
|
|
c.Flags.Set(17)
|
|
c.RecentRequesters = value
|
|
}
|
|
|
|
// GetRecentRequesters returns value of RecentRequesters conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetRecentRequesters() (value []int64, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(17) {
|
|
return value, false
|
|
}
|
|
return c.RecentRequesters, true
|
|
}
|
|
|
|
// SetAvailableReactions sets value of AvailableReactions conditional field.
|
|
func (c *ChatFull) SetAvailableReactions(value ChatReactionsClass) {
|
|
c.Flags.Set(18)
|
|
c.AvailableReactions = value
|
|
}
|
|
|
|
// GetAvailableReactions returns value of AvailableReactions conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetAvailableReactions() (value ChatReactionsClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(18) {
|
|
return value, false
|
|
}
|
|
return c.AvailableReactions, true
|
|
}
|
|
|
|
// SetReactionsLimit sets value of ReactionsLimit conditional field.
|
|
func (c *ChatFull) SetReactionsLimit(value int) {
|
|
c.Flags.Set(20)
|
|
c.ReactionsLimit = value
|
|
}
|
|
|
|
// GetReactionsLimit returns value of ReactionsLimit conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChatFull) GetReactionsLimit() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(20) {
|
|
return value, false
|
|
}
|
|
return c.ReactionsLimit, true
|
|
}
|
|
|
|
// ChannelFull represents TL type `channelFull#52d6806b`.
|
|
// Full info about a channel¹, supergroup² or gigagroup³.
|
|
// When updating the local peer database »¹, all fields from the newly received
|
|
// constructor take priority over the old constructor cached locally (including by
|
|
// removing fields that aren't set in the new constructor).
|
|
//
|
|
// Links:
|
|
// 1. https://core.telegram.org/api/channel#channels
|
|
// 2. https://core.telegram.org/api/channel#supergroups
|
|
// 3. https://core.telegram.org/api/channel#gigagroups
|
|
// 4. https://core.telegram.org/api/peers
|
|
//
|
|
// See https://core.telegram.org/constructor/channelFull for reference.
|
|
type ChannelFull struct {
|
|
// Flags, see TL conditional fields¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
|
|
Flags bin.Fields
|
|
// Can we view the participant list?
|
|
CanViewParticipants bool
|
|
// Can we set the channel's username?
|
|
CanSetUsername bool
|
|
// Can we associate¹ a stickerpack to the supergroup?
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/method/channels.setStickers
|
|
CanSetStickers bool
|
|
// Is the history before we joined hidden to us?
|
|
HiddenPrehistory bool
|
|
// Can we set the geolocation of this group (for geogroups)
|
|
CanSetLocation bool
|
|
// Whether scheduled messages are available
|
|
HasScheduled bool
|
|
// Can the user view channel/supergroup statistics¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stats
|
|
CanViewStats bool
|
|
// Whether any anonymous admin of this supergroup was blocked: if set, you won't receive
|
|
// messages from anonymous group admins in discussion replies via @replies¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/discussion
|
|
Blocked bool
|
|
// Flags, see TL conditional fields¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
|
|
Flags2 bin.Fields
|
|
// Can we delete this channel?
|
|
CanDeleteChannel bool
|
|
// Whether native antispam¹ functionality is enabled in this supergroup.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/antispam
|
|
Antispam bool
|
|
// Whether the participant list is hidden.
|
|
ParticipantsHidden bool
|
|
// Whether the real-time chat translation popup¹ should be hidden.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/translation
|
|
TranslationsDisabled bool
|
|
// Whether this user has some pinned stories¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stories#pinned-or-archived-stories
|
|
StoriesPinnedAvailable bool
|
|
// Users may also choose to display messages from all topics of a forum¹ as if they were
|
|
// sent to a normal group, using a "View as messages" setting in the local client. This
|
|
// setting only affects the current account, and is synced to other logged in sessions
|
|
// using the channels.toggleViewForumAsMessages² method; invoking this method will
|
|
// update the value of this flag.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/forum
|
|
// 2) https://core.telegram.org/method/channels.toggleViewForumAsMessages
|
|
ViewForumAsMessages bool
|
|
// Whether ads on this channel were disabled as specified here »¹ (this flag is only
|
|
// visible to the owner of the channel).
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/boost#disable-ads-on-the-channel
|
|
RestrictedSponsored bool
|
|
// If set, this user can view ad revenue statistics »¹ for this channel.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/revenue#revenue-statistics
|
|
CanViewRevenue bool
|
|
// Whether the current user can send or forward paid media »¹ to this channel.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/paid-media
|
|
PaidMediaAllowed bool
|
|
// If set, this user can view Telegram Star revenue statistics »¹ for this channel.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stars#revenue-statistics
|
|
CanViewStarsRevenue bool
|
|
// If set, users may send paid Telegram Star reactions »¹ to messages of this channel.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/reactions#paid-reactions
|
|
PaidReactionsAvailable bool
|
|
// StargiftsAvailable field of ChannelFull.
|
|
StargiftsAvailable bool
|
|
// PaidMessagesAvailable field of ChannelFull.
|
|
PaidMessagesAvailable bool
|
|
// ID of the channel
|
|
ID int64
|
|
// Info about the channel
|
|
About string
|
|
// Number of participants of the channel
|
|
//
|
|
// Use SetParticipantsCount and GetParticipantsCount helpers.
|
|
ParticipantsCount int
|
|
// Number of channel admins
|
|
//
|
|
// Use SetAdminsCount and GetAdminsCount helpers.
|
|
AdminsCount int
|
|
// Number of users kicked¹ from the channel
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/rights
|
|
//
|
|
// Use SetKickedCount and GetKickedCount helpers.
|
|
KickedCount int
|
|
// Number of users banned¹ from the channel
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/rights
|
|
//
|
|
// Use SetBannedCount and GetBannedCount helpers.
|
|
BannedCount int
|
|
// Number of users currently online
|
|
//
|
|
// Use SetOnlineCount and GetOnlineCount helpers.
|
|
OnlineCount int
|
|
// Position up to which all incoming messages are read.
|
|
ReadInboxMaxID int
|
|
// Position up to which all outgoing messages are read.
|
|
ReadOutboxMaxID int
|
|
// Count of unread messages
|
|
UnreadCount int
|
|
// Channel picture
|
|
ChatPhoto PhotoClass
|
|
// Notification settings
|
|
NotifySettings PeerNotifySettings
|
|
// Invite link
|
|
//
|
|
// Use SetExportedInvite and GetExportedInvite helpers.
|
|
ExportedInvite ExportedChatInviteClass
|
|
// Info about bots in the channel/supergroup
|
|
BotInfo []BotInfo
|
|
// The chat ID from which this group was migrated¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/channel
|
|
//
|
|
// Use SetMigratedFromChatID and GetMigratedFromChatID helpers.
|
|
MigratedFromChatID int64
|
|
// The message ID in the original chat at which this group was migrated¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/channel
|
|
//
|
|
// Use SetMigratedFromMaxID and GetMigratedFromMaxID helpers.
|
|
MigratedFromMaxID int
|
|
// Message ID of the last pinned message¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/pin
|
|
//
|
|
// Use SetPinnedMsgID and GetPinnedMsgID helpers.
|
|
PinnedMsgID int
|
|
// Associated stickerset
|
|
//
|
|
// Use SetStickerset and GetStickerset helpers.
|
|
Stickerset StickerSet
|
|
// Identifier of a maximum unavailable message in a channel due to hidden history.
|
|
//
|
|
// Use SetAvailableMinID and GetAvailableMinID helpers.
|
|
AvailableMinID int
|
|
// Peer folder ID, for more info click here¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/folders#peer-folders
|
|
//
|
|
// Use SetFolderID and GetFolderID helpers.
|
|
FolderID int
|
|
// ID of the linked discussion chat¹ for channels (and vice versa, the ID of the linked
|
|
// channel for discussion chats).
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/discussion
|
|
//
|
|
// Use SetLinkedChatID and GetLinkedChatID helpers.
|
|
LinkedChatID int64
|
|
// Location of the geogroup
|
|
//
|
|
// Use SetLocation and GetLocation helpers.
|
|
Location ChannelLocationClass
|
|
// If specified, users in supergroups will only be able to send one message every
|
|
// slowmode_seconds seconds
|
|
//
|
|
// Use SetSlowmodeSeconds and GetSlowmodeSeconds helpers.
|
|
SlowmodeSeconds int
|
|
// Indicates when the user will be allowed to send another message in the supergroup
|
|
// (unixtime)
|
|
//
|
|
// Use SetSlowmodeNextSendDate and GetSlowmodeNextSendDate helpers.
|
|
SlowmodeNextSendDate int
|
|
// If set, specifies the DC to use for fetching channel statistics
|
|
//
|
|
// Use SetStatsDC and GetStatsDC helpers.
|
|
StatsDC int
|
|
// Latest PTS¹ for this channel
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/updates
|
|
Pts int
|
|
// Livestream or group call information
|
|
//
|
|
// Use SetCall and GetCall helpers.
|
|
Call InputGroupCallClass
|
|
// Time-To-Live of messages in this channel or supergroup
|
|
//
|
|
// Use SetTTLPeriod and GetTTLPeriod helpers.
|
|
TTLPeriod int
|
|
// A list of suggested actions¹ for the supergroup admin, see here for more info »².
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/config#suggestions
|
|
// 2) https://core.telegram.org/api/config#suggestions
|
|
//
|
|
// Use SetPendingSuggestions and GetPendingSuggestions helpers.
|
|
PendingSuggestions []string
|
|
// When using phone.getGroupCallJoinAs¹ to get a list of peers that can be used to join
|
|
// a group call, this field indicates the peer that should be selected by default.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/method/phone.getGroupCallJoinAs
|
|
//
|
|
// Use SetGroupcallDefaultJoinAs and GetGroupcallDefaultJoinAs helpers.
|
|
GroupcallDefaultJoinAs PeerClass
|
|
// Emoji representing a specific chat theme
|
|
//
|
|
// Use SetThemeEmoticon and GetThemeEmoticon helpers.
|
|
ThemeEmoticon string
|
|
// Pending join requests »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/invites#join-requests
|
|
//
|
|
// Use SetRequestsPending and GetRequestsPending helpers.
|
|
RequestsPending int
|
|
// IDs of users who requested to join recently
|
|
//
|
|
// Use SetRecentRequesters and GetRecentRequesters helpers.
|
|
RecentRequesters []int64
|
|
// Default peer used for sending messages to this channel
|
|
//
|
|
// Use SetDefaultSendAs and GetDefaultSendAs helpers.
|
|
DefaultSendAs PeerClass
|
|
// Allowed message reactions »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/reactions
|
|
//
|
|
// Use SetAvailableReactions and GetAvailableReactions helpers.
|
|
AvailableReactions ChatReactionsClass
|
|
// This flag may be used to impose a custom limit of unique reactions (i.e. a
|
|
// customizable version of appConfig.reactions_uniq_max¹).
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/config#reactions-uniq-max
|
|
//
|
|
// Use SetReactionsLimit and GetReactionsLimit helpers.
|
|
ReactionsLimit int
|
|
// Channel stories¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stories
|
|
//
|
|
// Use SetStories and GetStories helpers.
|
|
Stories PeerStories
|
|
// Wallpaper¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/wallpapers
|
|
//
|
|
// Use SetWallpaper and GetWallpaper helpers.
|
|
Wallpaper WallPaperClass
|
|
// The number of boosts¹ the current user has applied to the current supergroup.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/boost
|
|
//
|
|
// Use SetBoostsApplied and GetBoostsApplied helpers.
|
|
BoostsApplied int
|
|
// The number of boosts¹ this supergroup requires to bypass slowmode and other
|
|
// restrictions, see here »² for more info.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/boost
|
|
// 2) https://core.telegram.org/api/boost#bypass-slowmode-and-chat-restrictions
|
|
//
|
|
// Use SetBoostsUnrestrict and GetBoostsUnrestrict helpers.
|
|
BoostsUnrestrict int
|
|
// Custom emoji stickerset¹ associated to the current supergroup, set using channels
|
|
// setEmojiStickers² after reaching the appropriate boost level, see here »³ for more
|
|
// info.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/custom-emoji
|
|
// 2) https://core.telegram.org/method/channels.setEmojiStickers
|
|
// 3) https://core.telegram.org/api/boost#setting-a-custom-emoji-stickerset-for-supergroups
|
|
//
|
|
// Use SetEmojiset and GetEmojiset helpers.
|
|
Emojiset StickerSet
|
|
// BotVerification field of ChannelFull.
|
|
//
|
|
// Use SetBotVerification and GetBotVerification helpers.
|
|
BotVerification BotVerification
|
|
// StargiftsCount field of ChannelFull.
|
|
//
|
|
// Use SetStargiftsCount and GetStargiftsCount helpers.
|
|
StargiftsCount int
|
|
}
|
|
|
|
// ChannelFullTypeID is TL type id of ChannelFull.
|
|
const ChannelFullTypeID = 0x52d6806b
|
|
|
|
// construct implements constructor of ChatFullClass.
|
|
func (c ChannelFull) construct() ChatFullClass { return &c }
|
|
|
|
// Ensuring interfaces in compile-time for ChannelFull.
|
|
var (
|
|
_ bin.Encoder = &ChannelFull{}
|
|
_ bin.Decoder = &ChannelFull{}
|
|
_ bin.BareEncoder = &ChannelFull{}
|
|
_ bin.BareDecoder = &ChannelFull{}
|
|
|
|
_ ChatFullClass = &ChannelFull{}
|
|
)
|
|
|
|
func (c *ChannelFull) Zero() bool {
|
|
if c == nil {
|
|
return true
|
|
}
|
|
if !(c.Flags.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.CanViewParticipants == false) {
|
|
return false
|
|
}
|
|
if !(c.CanSetUsername == false) {
|
|
return false
|
|
}
|
|
if !(c.CanSetStickers == false) {
|
|
return false
|
|
}
|
|
if !(c.HiddenPrehistory == false) {
|
|
return false
|
|
}
|
|
if !(c.CanSetLocation == false) {
|
|
return false
|
|
}
|
|
if !(c.HasScheduled == false) {
|
|
return false
|
|
}
|
|
if !(c.CanViewStats == false) {
|
|
return false
|
|
}
|
|
if !(c.Blocked == false) {
|
|
return false
|
|
}
|
|
if !(c.Flags2.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.CanDeleteChannel == false) {
|
|
return false
|
|
}
|
|
if !(c.Antispam == false) {
|
|
return false
|
|
}
|
|
if !(c.ParticipantsHidden == false) {
|
|
return false
|
|
}
|
|
if !(c.TranslationsDisabled == false) {
|
|
return false
|
|
}
|
|
if !(c.StoriesPinnedAvailable == false) {
|
|
return false
|
|
}
|
|
if !(c.ViewForumAsMessages == false) {
|
|
return false
|
|
}
|
|
if !(c.RestrictedSponsored == false) {
|
|
return false
|
|
}
|
|
if !(c.CanViewRevenue == false) {
|
|
return false
|
|
}
|
|
if !(c.PaidMediaAllowed == false) {
|
|
return false
|
|
}
|
|
if !(c.CanViewStarsRevenue == false) {
|
|
return false
|
|
}
|
|
if !(c.PaidReactionsAvailable == false) {
|
|
return false
|
|
}
|
|
if !(c.StargiftsAvailable == false) {
|
|
return false
|
|
}
|
|
if !(c.PaidMessagesAvailable == false) {
|
|
return false
|
|
}
|
|
if !(c.ID == 0) {
|
|
return false
|
|
}
|
|
if !(c.About == "") {
|
|
return false
|
|
}
|
|
if !(c.ParticipantsCount == 0) {
|
|
return false
|
|
}
|
|
if !(c.AdminsCount == 0) {
|
|
return false
|
|
}
|
|
if !(c.KickedCount == 0) {
|
|
return false
|
|
}
|
|
if !(c.BannedCount == 0) {
|
|
return false
|
|
}
|
|
if !(c.OnlineCount == 0) {
|
|
return false
|
|
}
|
|
if !(c.ReadInboxMaxID == 0) {
|
|
return false
|
|
}
|
|
if !(c.ReadOutboxMaxID == 0) {
|
|
return false
|
|
}
|
|
if !(c.UnreadCount == 0) {
|
|
return false
|
|
}
|
|
if !(c.ChatPhoto == nil) {
|
|
return false
|
|
}
|
|
if !(c.NotifySettings.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.ExportedInvite == nil) {
|
|
return false
|
|
}
|
|
if !(c.BotInfo == nil) {
|
|
return false
|
|
}
|
|
if !(c.MigratedFromChatID == 0) {
|
|
return false
|
|
}
|
|
if !(c.MigratedFromMaxID == 0) {
|
|
return false
|
|
}
|
|
if !(c.PinnedMsgID == 0) {
|
|
return false
|
|
}
|
|
if !(c.Stickerset.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.AvailableMinID == 0) {
|
|
return false
|
|
}
|
|
if !(c.FolderID == 0) {
|
|
return false
|
|
}
|
|
if !(c.LinkedChatID == 0) {
|
|
return false
|
|
}
|
|
if !(c.Location == nil) {
|
|
return false
|
|
}
|
|
if !(c.SlowmodeSeconds == 0) {
|
|
return false
|
|
}
|
|
if !(c.SlowmodeNextSendDate == 0) {
|
|
return false
|
|
}
|
|
if !(c.StatsDC == 0) {
|
|
return false
|
|
}
|
|
if !(c.Pts == 0) {
|
|
return false
|
|
}
|
|
if !(c.Call == nil) {
|
|
return false
|
|
}
|
|
if !(c.TTLPeriod == 0) {
|
|
return false
|
|
}
|
|
if !(c.PendingSuggestions == nil) {
|
|
return false
|
|
}
|
|
if !(c.GroupcallDefaultJoinAs == nil) {
|
|
return false
|
|
}
|
|
if !(c.ThemeEmoticon == "") {
|
|
return false
|
|
}
|
|
if !(c.RequestsPending == 0) {
|
|
return false
|
|
}
|
|
if !(c.RecentRequesters == nil) {
|
|
return false
|
|
}
|
|
if !(c.DefaultSendAs == nil) {
|
|
return false
|
|
}
|
|
if !(c.AvailableReactions == nil) {
|
|
return false
|
|
}
|
|
if !(c.ReactionsLimit == 0) {
|
|
return false
|
|
}
|
|
if !(c.Stories.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.Wallpaper == nil) {
|
|
return false
|
|
}
|
|
if !(c.BoostsApplied == 0) {
|
|
return false
|
|
}
|
|
if !(c.BoostsUnrestrict == 0) {
|
|
return false
|
|
}
|
|
if !(c.Emojiset.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.BotVerification.Zero()) {
|
|
return false
|
|
}
|
|
if !(c.StargiftsCount == 0) {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
// String implements fmt.Stringer.
|
|
func (c *ChannelFull) String() string {
|
|
if c == nil {
|
|
return "ChannelFull(nil)"
|
|
}
|
|
type Alias ChannelFull
|
|
return fmt.Sprintf("ChannelFull%+v", Alias(*c))
|
|
}
|
|
|
|
// FillFrom fills ChannelFull from given interface.
|
|
func (c *ChannelFull) FillFrom(from interface {
|
|
GetCanViewParticipants() (value bool)
|
|
GetCanSetUsername() (value bool)
|
|
GetCanSetStickers() (value bool)
|
|
GetHiddenPrehistory() (value bool)
|
|
GetCanSetLocation() (value bool)
|
|
GetHasScheduled() (value bool)
|
|
GetCanViewStats() (value bool)
|
|
GetBlocked() (value bool)
|
|
GetCanDeleteChannel() (value bool)
|
|
GetAntispam() (value bool)
|
|
GetParticipantsHidden() (value bool)
|
|
GetTranslationsDisabled() (value bool)
|
|
GetStoriesPinnedAvailable() (value bool)
|
|
GetViewForumAsMessages() (value bool)
|
|
GetRestrictedSponsored() (value bool)
|
|
GetCanViewRevenue() (value bool)
|
|
GetPaidMediaAllowed() (value bool)
|
|
GetCanViewStarsRevenue() (value bool)
|
|
GetPaidReactionsAvailable() (value bool)
|
|
GetStargiftsAvailable() (value bool)
|
|
GetPaidMessagesAvailable() (value bool)
|
|
GetID() (value int64)
|
|
GetAbout() (value string)
|
|
GetParticipantsCount() (value int, ok bool)
|
|
GetAdminsCount() (value int, ok bool)
|
|
GetKickedCount() (value int, ok bool)
|
|
GetBannedCount() (value int, ok bool)
|
|
GetOnlineCount() (value int, ok bool)
|
|
GetReadInboxMaxID() (value int)
|
|
GetReadOutboxMaxID() (value int)
|
|
GetUnreadCount() (value int)
|
|
GetChatPhoto() (value PhotoClass)
|
|
GetNotifySettings() (value PeerNotifySettings)
|
|
GetExportedInvite() (value ExportedChatInviteClass, ok bool)
|
|
GetBotInfo() (value []BotInfo)
|
|
GetMigratedFromChatID() (value int64, ok bool)
|
|
GetMigratedFromMaxID() (value int, ok bool)
|
|
GetPinnedMsgID() (value int, ok bool)
|
|
GetStickerset() (value StickerSet, ok bool)
|
|
GetAvailableMinID() (value int, ok bool)
|
|
GetFolderID() (value int, ok bool)
|
|
GetLinkedChatID() (value int64, ok bool)
|
|
GetLocation() (value ChannelLocationClass, ok bool)
|
|
GetSlowmodeSeconds() (value int, ok bool)
|
|
GetSlowmodeNextSendDate() (value int, ok bool)
|
|
GetStatsDC() (value int, ok bool)
|
|
GetPts() (value int)
|
|
GetCall() (value InputGroupCallClass, ok bool)
|
|
GetTTLPeriod() (value int, ok bool)
|
|
GetPendingSuggestions() (value []string, ok bool)
|
|
GetGroupcallDefaultJoinAs() (value PeerClass, ok bool)
|
|
GetThemeEmoticon() (value string, ok bool)
|
|
GetRequestsPending() (value int, ok bool)
|
|
GetRecentRequesters() (value []int64, ok bool)
|
|
GetDefaultSendAs() (value PeerClass, ok bool)
|
|
GetAvailableReactions() (value ChatReactionsClass, ok bool)
|
|
GetReactionsLimit() (value int, ok bool)
|
|
GetStories() (value PeerStories, ok bool)
|
|
GetWallpaper() (value WallPaperClass, ok bool)
|
|
GetBoostsApplied() (value int, ok bool)
|
|
GetBoostsUnrestrict() (value int, ok bool)
|
|
GetEmojiset() (value StickerSet, ok bool)
|
|
GetBotVerification() (value BotVerification, ok bool)
|
|
GetStargiftsCount() (value int, ok bool)
|
|
}) {
|
|
c.CanViewParticipants = from.GetCanViewParticipants()
|
|
c.CanSetUsername = from.GetCanSetUsername()
|
|
c.CanSetStickers = from.GetCanSetStickers()
|
|
c.HiddenPrehistory = from.GetHiddenPrehistory()
|
|
c.CanSetLocation = from.GetCanSetLocation()
|
|
c.HasScheduled = from.GetHasScheduled()
|
|
c.CanViewStats = from.GetCanViewStats()
|
|
c.Blocked = from.GetBlocked()
|
|
c.CanDeleteChannel = from.GetCanDeleteChannel()
|
|
c.Antispam = from.GetAntispam()
|
|
c.ParticipantsHidden = from.GetParticipantsHidden()
|
|
c.TranslationsDisabled = from.GetTranslationsDisabled()
|
|
c.StoriesPinnedAvailable = from.GetStoriesPinnedAvailable()
|
|
c.ViewForumAsMessages = from.GetViewForumAsMessages()
|
|
c.RestrictedSponsored = from.GetRestrictedSponsored()
|
|
c.CanViewRevenue = from.GetCanViewRevenue()
|
|
c.PaidMediaAllowed = from.GetPaidMediaAllowed()
|
|
c.CanViewStarsRevenue = from.GetCanViewStarsRevenue()
|
|
c.PaidReactionsAvailable = from.GetPaidReactionsAvailable()
|
|
c.StargiftsAvailable = from.GetStargiftsAvailable()
|
|
c.PaidMessagesAvailable = from.GetPaidMessagesAvailable()
|
|
c.ID = from.GetID()
|
|
c.About = from.GetAbout()
|
|
if val, ok := from.GetParticipantsCount(); ok {
|
|
c.ParticipantsCount = val
|
|
}
|
|
|
|
if val, ok := from.GetAdminsCount(); ok {
|
|
c.AdminsCount = val
|
|
}
|
|
|
|
if val, ok := from.GetKickedCount(); ok {
|
|
c.KickedCount = val
|
|
}
|
|
|
|
if val, ok := from.GetBannedCount(); ok {
|
|
c.BannedCount = val
|
|
}
|
|
|
|
if val, ok := from.GetOnlineCount(); ok {
|
|
c.OnlineCount = val
|
|
}
|
|
|
|
c.ReadInboxMaxID = from.GetReadInboxMaxID()
|
|
c.ReadOutboxMaxID = from.GetReadOutboxMaxID()
|
|
c.UnreadCount = from.GetUnreadCount()
|
|
c.ChatPhoto = from.GetChatPhoto()
|
|
c.NotifySettings = from.GetNotifySettings()
|
|
if val, ok := from.GetExportedInvite(); ok {
|
|
c.ExportedInvite = val
|
|
}
|
|
|
|
c.BotInfo = from.GetBotInfo()
|
|
if val, ok := from.GetMigratedFromChatID(); ok {
|
|
c.MigratedFromChatID = val
|
|
}
|
|
|
|
if val, ok := from.GetMigratedFromMaxID(); ok {
|
|
c.MigratedFromMaxID = val
|
|
}
|
|
|
|
if val, ok := from.GetPinnedMsgID(); ok {
|
|
c.PinnedMsgID = val
|
|
}
|
|
|
|
if val, ok := from.GetStickerset(); ok {
|
|
c.Stickerset = val
|
|
}
|
|
|
|
if val, ok := from.GetAvailableMinID(); ok {
|
|
c.AvailableMinID = val
|
|
}
|
|
|
|
if val, ok := from.GetFolderID(); ok {
|
|
c.FolderID = val
|
|
}
|
|
|
|
if val, ok := from.GetLinkedChatID(); ok {
|
|
c.LinkedChatID = val
|
|
}
|
|
|
|
if val, ok := from.GetLocation(); ok {
|
|
c.Location = val
|
|
}
|
|
|
|
if val, ok := from.GetSlowmodeSeconds(); ok {
|
|
c.SlowmodeSeconds = val
|
|
}
|
|
|
|
if val, ok := from.GetSlowmodeNextSendDate(); ok {
|
|
c.SlowmodeNextSendDate = val
|
|
}
|
|
|
|
if val, ok := from.GetStatsDC(); ok {
|
|
c.StatsDC = val
|
|
}
|
|
|
|
c.Pts = from.GetPts()
|
|
if val, ok := from.GetCall(); ok {
|
|
c.Call = val
|
|
}
|
|
|
|
if val, ok := from.GetTTLPeriod(); ok {
|
|
c.TTLPeriod = val
|
|
}
|
|
|
|
if val, ok := from.GetPendingSuggestions(); ok {
|
|
c.PendingSuggestions = val
|
|
}
|
|
|
|
if val, ok := from.GetGroupcallDefaultJoinAs(); ok {
|
|
c.GroupcallDefaultJoinAs = val
|
|
}
|
|
|
|
if val, ok := from.GetThemeEmoticon(); ok {
|
|
c.ThemeEmoticon = val
|
|
}
|
|
|
|
if val, ok := from.GetRequestsPending(); ok {
|
|
c.RequestsPending = val
|
|
}
|
|
|
|
if val, ok := from.GetRecentRequesters(); ok {
|
|
c.RecentRequesters = val
|
|
}
|
|
|
|
if val, ok := from.GetDefaultSendAs(); ok {
|
|
c.DefaultSendAs = val
|
|
}
|
|
|
|
if val, ok := from.GetAvailableReactions(); ok {
|
|
c.AvailableReactions = val
|
|
}
|
|
|
|
if val, ok := from.GetReactionsLimit(); ok {
|
|
c.ReactionsLimit = val
|
|
}
|
|
|
|
if val, ok := from.GetStories(); ok {
|
|
c.Stories = val
|
|
}
|
|
|
|
if val, ok := from.GetWallpaper(); ok {
|
|
c.Wallpaper = val
|
|
}
|
|
|
|
if val, ok := from.GetBoostsApplied(); ok {
|
|
c.BoostsApplied = val
|
|
}
|
|
|
|
if val, ok := from.GetBoostsUnrestrict(); ok {
|
|
c.BoostsUnrestrict = val
|
|
}
|
|
|
|
if val, ok := from.GetEmojiset(); ok {
|
|
c.Emojiset = val
|
|
}
|
|
|
|
if val, ok := from.GetBotVerification(); ok {
|
|
c.BotVerification = val
|
|
}
|
|
|
|
if val, ok := from.GetStargiftsCount(); ok {
|
|
c.StargiftsCount = val
|
|
}
|
|
|
|
}
|
|
|
|
// TypeID returns type id in TL schema.
|
|
//
|
|
// See https://core.telegram.org/mtproto/TL-tl#remarks.
|
|
func (*ChannelFull) TypeID() uint32 {
|
|
return ChannelFullTypeID
|
|
}
|
|
|
|
// TypeName returns name of type in TL schema.
|
|
func (*ChannelFull) TypeName() string {
|
|
return "channelFull"
|
|
}
|
|
|
|
// TypeInfo returns info about TL type.
|
|
func (c *ChannelFull) TypeInfo() tdp.Type {
|
|
typ := tdp.Type{
|
|
Name: "channelFull",
|
|
ID: ChannelFullTypeID,
|
|
}
|
|
if c == nil {
|
|
typ.Null = true
|
|
return typ
|
|
}
|
|
typ.Fields = []tdp.Field{
|
|
{
|
|
Name: "CanViewParticipants",
|
|
SchemaName: "can_view_participants",
|
|
Null: !c.Flags.Has(3),
|
|
},
|
|
{
|
|
Name: "CanSetUsername",
|
|
SchemaName: "can_set_username",
|
|
Null: !c.Flags.Has(6),
|
|
},
|
|
{
|
|
Name: "CanSetStickers",
|
|
SchemaName: "can_set_stickers",
|
|
Null: !c.Flags.Has(7),
|
|
},
|
|
{
|
|
Name: "HiddenPrehistory",
|
|
SchemaName: "hidden_prehistory",
|
|
Null: !c.Flags.Has(10),
|
|
},
|
|
{
|
|
Name: "CanSetLocation",
|
|
SchemaName: "can_set_location",
|
|
Null: !c.Flags.Has(16),
|
|
},
|
|
{
|
|
Name: "HasScheduled",
|
|
SchemaName: "has_scheduled",
|
|
Null: !c.Flags.Has(19),
|
|
},
|
|
{
|
|
Name: "CanViewStats",
|
|
SchemaName: "can_view_stats",
|
|
Null: !c.Flags.Has(20),
|
|
},
|
|
{
|
|
Name: "Blocked",
|
|
SchemaName: "blocked",
|
|
Null: !c.Flags.Has(22),
|
|
},
|
|
{
|
|
Name: "CanDeleteChannel",
|
|
SchemaName: "can_delete_channel",
|
|
Null: !c.Flags2.Has(0),
|
|
},
|
|
{
|
|
Name: "Antispam",
|
|
SchemaName: "antispam",
|
|
Null: !c.Flags2.Has(1),
|
|
},
|
|
{
|
|
Name: "ParticipantsHidden",
|
|
SchemaName: "participants_hidden",
|
|
Null: !c.Flags2.Has(2),
|
|
},
|
|
{
|
|
Name: "TranslationsDisabled",
|
|
SchemaName: "translations_disabled",
|
|
Null: !c.Flags2.Has(3),
|
|
},
|
|
{
|
|
Name: "StoriesPinnedAvailable",
|
|
SchemaName: "stories_pinned_available",
|
|
Null: !c.Flags2.Has(5),
|
|
},
|
|
{
|
|
Name: "ViewForumAsMessages",
|
|
SchemaName: "view_forum_as_messages",
|
|
Null: !c.Flags2.Has(6),
|
|
},
|
|
{
|
|
Name: "RestrictedSponsored",
|
|
SchemaName: "restricted_sponsored",
|
|
Null: !c.Flags2.Has(11),
|
|
},
|
|
{
|
|
Name: "CanViewRevenue",
|
|
SchemaName: "can_view_revenue",
|
|
Null: !c.Flags2.Has(12),
|
|
},
|
|
{
|
|
Name: "PaidMediaAllowed",
|
|
SchemaName: "paid_media_allowed",
|
|
Null: !c.Flags2.Has(14),
|
|
},
|
|
{
|
|
Name: "CanViewStarsRevenue",
|
|
SchemaName: "can_view_stars_revenue",
|
|
Null: !c.Flags2.Has(15),
|
|
},
|
|
{
|
|
Name: "PaidReactionsAvailable",
|
|
SchemaName: "paid_reactions_available",
|
|
Null: !c.Flags2.Has(16),
|
|
},
|
|
{
|
|
Name: "StargiftsAvailable",
|
|
SchemaName: "stargifts_available",
|
|
Null: !c.Flags2.Has(19),
|
|
},
|
|
{
|
|
Name: "PaidMessagesAvailable",
|
|
SchemaName: "paid_messages_available",
|
|
Null: !c.Flags2.Has(20),
|
|
},
|
|
{
|
|
Name: "ID",
|
|
SchemaName: "id",
|
|
},
|
|
{
|
|
Name: "About",
|
|
SchemaName: "about",
|
|
},
|
|
{
|
|
Name: "ParticipantsCount",
|
|
SchemaName: "participants_count",
|
|
Null: !c.Flags.Has(0),
|
|
},
|
|
{
|
|
Name: "AdminsCount",
|
|
SchemaName: "admins_count",
|
|
Null: !c.Flags.Has(1),
|
|
},
|
|
{
|
|
Name: "KickedCount",
|
|
SchemaName: "kicked_count",
|
|
Null: !c.Flags.Has(2),
|
|
},
|
|
{
|
|
Name: "BannedCount",
|
|
SchemaName: "banned_count",
|
|
Null: !c.Flags.Has(2),
|
|
},
|
|
{
|
|
Name: "OnlineCount",
|
|
SchemaName: "online_count",
|
|
Null: !c.Flags.Has(13),
|
|
},
|
|
{
|
|
Name: "ReadInboxMaxID",
|
|
SchemaName: "read_inbox_max_id",
|
|
},
|
|
{
|
|
Name: "ReadOutboxMaxID",
|
|
SchemaName: "read_outbox_max_id",
|
|
},
|
|
{
|
|
Name: "UnreadCount",
|
|
SchemaName: "unread_count",
|
|
},
|
|
{
|
|
Name: "ChatPhoto",
|
|
SchemaName: "chat_photo",
|
|
},
|
|
{
|
|
Name: "NotifySettings",
|
|
SchemaName: "notify_settings",
|
|
},
|
|
{
|
|
Name: "ExportedInvite",
|
|
SchemaName: "exported_invite",
|
|
Null: !c.Flags.Has(23),
|
|
},
|
|
{
|
|
Name: "BotInfo",
|
|
SchemaName: "bot_info",
|
|
},
|
|
{
|
|
Name: "MigratedFromChatID",
|
|
SchemaName: "migrated_from_chat_id",
|
|
Null: !c.Flags.Has(4),
|
|
},
|
|
{
|
|
Name: "MigratedFromMaxID",
|
|
SchemaName: "migrated_from_max_id",
|
|
Null: !c.Flags.Has(4),
|
|
},
|
|
{
|
|
Name: "PinnedMsgID",
|
|
SchemaName: "pinned_msg_id",
|
|
Null: !c.Flags.Has(5),
|
|
},
|
|
{
|
|
Name: "Stickerset",
|
|
SchemaName: "stickerset",
|
|
Null: !c.Flags.Has(8),
|
|
},
|
|
{
|
|
Name: "AvailableMinID",
|
|
SchemaName: "available_min_id",
|
|
Null: !c.Flags.Has(9),
|
|
},
|
|
{
|
|
Name: "FolderID",
|
|
SchemaName: "folder_id",
|
|
Null: !c.Flags.Has(11),
|
|
},
|
|
{
|
|
Name: "LinkedChatID",
|
|
SchemaName: "linked_chat_id",
|
|
Null: !c.Flags.Has(14),
|
|
},
|
|
{
|
|
Name: "Location",
|
|
SchemaName: "location",
|
|
Null: !c.Flags.Has(15),
|
|
},
|
|
{
|
|
Name: "SlowmodeSeconds",
|
|
SchemaName: "slowmode_seconds",
|
|
Null: !c.Flags.Has(17),
|
|
},
|
|
{
|
|
Name: "SlowmodeNextSendDate",
|
|
SchemaName: "slowmode_next_send_date",
|
|
Null: !c.Flags.Has(18),
|
|
},
|
|
{
|
|
Name: "StatsDC",
|
|
SchemaName: "stats_dc",
|
|
Null: !c.Flags.Has(12),
|
|
},
|
|
{
|
|
Name: "Pts",
|
|
SchemaName: "pts",
|
|
},
|
|
{
|
|
Name: "Call",
|
|
SchemaName: "call",
|
|
Null: !c.Flags.Has(21),
|
|
},
|
|
{
|
|
Name: "TTLPeriod",
|
|
SchemaName: "ttl_period",
|
|
Null: !c.Flags.Has(24),
|
|
},
|
|
{
|
|
Name: "PendingSuggestions",
|
|
SchemaName: "pending_suggestions",
|
|
Null: !c.Flags.Has(25),
|
|
},
|
|
{
|
|
Name: "GroupcallDefaultJoinAs",
|
|
SchemaName: "groupcall_default_join_as",
|
|
Null: !c.Flags.Has(26),
|
|
},
|
|
{
|
|
Name: "ThemeEmoticon",
|
|
SchemaName: "theme_emoticon",
|
|
Null: !c.Flags.Has(27),
|
|
},
|
|
{
|
|
Name: "RequestsPending",
|
|
SchemaName: "requests_pending",
|
|
Null: !c.Flags.Has(28),
|
|
},
|
|
{
|
|
Name: "RecentRequesters",
|
|
SchemaName: "recent_requesters",
|
|
Null: !c.Flags.Has(28),
|
|
},
|
|
{
|
|
Name: "DefaultSendAs",
|
|
SchemaName: "default_send_as",
|
|
Null: !c.Flags.Has(29),
|
|
},
|
|
{
|
|
Name: "AvailableReactions",
|
|
SchemaName: "available_reactions",
|
|
Null: !c.Flags.Has(30),
|
|
},
|
|
{
|
|
Name: "ReactionsLimit",
|
|
SchemaName: "reactions_limit",
|
|
Null: !c.Flags2.Has(13),
|
|
},
|
|
{
|
|
Name: "Stories",
|
|
SchemaName: "stories",
|
|
Null: !c.Flags2.Has(4),
|
|
},
|
|
{
|
|
Name: "Wallpaper",
|
|
SchemaName: "wallpaper",
|
|
Null: !c.Flags2.Has(7),
|
|
},
|
|
{
|
|
Name: "BoostsApplied",
|
|
SchemaName: "boosts_applied",
|
|
Null: !c.Flags2.Has(8),
|
|
},
|
|
{
|
|
Name: "BoostsUnrestrict",
|
|
SchemaName: "boosts_unrestrict",
|
|
Null: !c.Flags2.Has(9),
|
|
},
|
|
{
|
|
Name: "Emojiset",
|
|
SchemaName: "emojiset",
|
|
Null: !c.Flags2.Has(10),
|
|
},
|
|
{
|
|
Name: "BotVerification",
|
|
SchemaName: "bot_verification",
|
|
Null: !c.Flags2.Has(17),
|
|
},
|
|
{
|
|
Name: "StargiftsCount",
|
|
SchemaName: "stargifts_count",
|
|
Null: !c.Flags2.Has(18),
|
|
},
|
|
}
|
|
return typ
|
|
}
|
|
|
|
// SetFlags sets flags for non-zero fields.
|
|
func (c *ChannelFull) SetFlags() {
|
|
if !(c.CanViewParticipants == false) {
|
|
c.Flags.Set(3)
|
|
}
|
|
if !(c.CanSetUsername == false) {
|
|
c.Flags.Set(6)
|
|
}
|
|
if !(c.CanSetStickers == false) {
|
|
c.Flags.Set(7)
|
|
}
|
|
if !(c.HiddenPrehistory == false) {
|
|
c.Flags.Set(10)
|
|
}
|
|
if !(c.CanSetLocation == false) {
|
|
c.Flags.Set(16)
|
|
}
|
|
if !(c.HasScheduled == false) {
|
|
c.Flags.Set(19)
|
|
}
|
|
if !(c.CanViewStats == false) {
|
|
c.Flags.Set(20)
|
|
}
|
|
if !(c.Blocked == false) {
|
|
c.Flags.Set(22)
|
|
}
|
|
if !(c.CanDeleteChannel == false) {
|
|
c.Flags2.Set(0)
|
|
}
|
|
if !(c.Antispam == false) {
|
|
c.Flags2.Set(1)
|
|
}
|
|
if !(c.ParticipantsHidden == false) {
|
|
c.Flags2.Set(2)
|
|
}
|
|
if !(c.TranslationsDisabled == false) {
|
|
c.Flags2.Set(3)
|
|
}
|
|
if !(c.StoriesPinnedAvailable == false) {
|
|
c.Flags2.Set(5)
|
|
}
|
|
if !(c.ViewForumAsMessages == false) {
|
|
c.Flags2.Set(6)
|
|
}
|
|
if !(c.RestrictedSponsored == false) {
|
|
c.Flags2.Set(11)
|
|
}
|
|
if !(c.CanViewRevenue == false) {
|
|
c.Flags2.Set(12)
|
|
}
|
|
if !(c.PaidMediaAllowed == false) {
|
|
c.Flags2.Set(14)
|
|
}
|
|
if !(c.CanViewStarsRevenue == false) {
|
|
c.Flags2.Set(15)
|
|
}
|
|
if !(c.PaidReactionsAvailable == false) {
|
|
c.Flags2.Set(16)
|
|
}
|
|
if !(c.StargiftsAvailable == false) {
|
|
c.Flags2.Set(19)
|
|
}
|
|
if !(c.PaidMessagesAvailable == false) {
|
|
c.Flags2.Set(20)
|
|
}
|
|
if !(c.ParticipantsCount == 0) {
|
|
c.Flags.Set(0)
|
|
}
|
|
if !(c.AdminsCount == 0) {
|
|
c.Flags.Set(1)
|
|
}
|
|
if !(c.KickedCount == 0) {
|
|
c.Flags.Set(2)
|
|
}
|
|
if !(c.BannedCount == 0) {
|
|
c.Flags.Set(2)
|
|
}
|
|
if !(c.OnlineCount == 0) {
|
|
c.Flags.Set(13)
|
|
}
|
|
if !(c.ExportedInvite == nil) {
|
|
c.Flags.Set(23)
|
|
}
|
|
if !(c.MigratedFromChatID == 0) {
|
|
c.Flags.Set(4)
|
|
}
|
|
if !(c.MigratedFromMaxID == 0) {
|
|
c.Flags.Set(4)
|
|
}
|
|
if !(c.PinnedMsgID == 0) {
|
|
c.Flags.Set(5)
|
|
}
|
|
if !(c.Stickerset.Zero()) {
|
|
c.Flags.Set(8)
|
|
}
|
|
if !(c.AvailableMinID == 0) {
|
|
c.Flags.Set(9)
|
|
}
|
|
if !(c.FolderID == 0) {
|
|
c.Flags.Set(11)
|
|
}
|
|
if !(c.LinkedChatID == 0) {
|
|
c.Flags.Set(14)
|
|
}
|
|
if !(c.Location == nil) {
|
|
c.Flags.Set(15)
|
|
}
|
|
if !(c.SlowmodeSeconds == 0) {
|
|
c.Flags.Set(17)
|
|
}
|
|
if !(c.SlowmodeNextSendDate == 0) {
|
|
c.Flags.Set(18)
|
|
}
|
|
if !(c.StatsDC == 0) {
|
|
c.Flags.Set(12)
|
|
}
|
|
if !(c.Call == nil) {
|
|
c.Flags.Set(21)
|
|
}
|
|
if !(c.TTLPeriod == 0) {
|
|
c.Flags.Set(24)
|
|
}
|
|
if !(c.PendingSuggestions == nil) {
|
|
c.Flags.Set(25)
|
|
}
|
|
if !(c.GroupcallDefaultJoinAs == nil) {
|
|
c.Flags.Set(26)
|
|
}
|
|
if !(c.ThemeEmoticon == "") {
|
|
c.Flags.Set(27)
|
|
}
|
|
if !(c.RequestsPending == 0) {
|
|
c.Flags.Set(28)
|
|
}
|
|
if !(c.RecentRequesters == nil) {
|
|
c.Flags.Set(28)
|
|
}
|
|
if !(c.DefaultSendAs == nil) {
|
|
c.Flags.Set(29)
|
|
}
|
|
if !(c.AvailableReactions == nil) {
|
|
c.Flags.Set(30)
|
|
}
|
|
if !(c.ReactionsLimit == 0) {
|
|
c.Flags2.Set(13)
|
|
}
|
|
if !(c.Stories.Zero()) {
|
|
c.Flags2.Set(4)
|
|
}
|
|
if !(c.Wallpaper == nil) {
|
|
c.Flags2.Set(7)
|
|
}
|
|
if !(c.BoostsApplied == 0) {
|
|
c.Flags2.Set(8)
|
|
}
|
|
if !(c.BoostsUnrestrict == 0) {
|
|
c.Flags2.Set(9)
|
|
}
|
|
if !(c.Emojiset.Zero()) {
|
|
c.Flags2.Set(10)
|
|
}
|
|
if !(c.BotVerification.Zero()) {
|
|
c.Flags2.Set(17)
|
|
}
|
|
if !(c.StargiftsCount == 0) {
|
|
c.Flags2.Set(18)
|
|
}
|
|
}
|
|
|
|
// Encode implements bin.Encoder.
|
|
func (c *ChannelFull) Encode(b *bin.Buffer) error {
|
|
if c == nil {
|
|
return fmt.Errorf("can't encode channelFull#52d6806b as nil")
|
|
}
|
|
b.PutID(ChannelFullTypeID)
|
|
return c.EncodeBare(b)
|
|
}
|
|
|
|
// EncodeBare implements bin.BareEncoder.
|
|
func (c *ChannelFull) EncodeBare(b *bin.Buffer) error {
|
|
if c == nil {
|
|
return fmt.Errorf("can't encode channelFull#52d6806b as nil")
|
|
}
|
|
c.SetFlags()
|
|
if err := c.Flags.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field flags: %w", err)
|
|
}
|
|
if err := c.Flags2.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field flags2: %w", err)
|
|
}
|
|
b.PutLong(c.ID)
|
|
b.PutString(c.About)
|
|
if c.Flags.Has(0) {
|
|
b.PutInt(c.ParticipantsCount)
|
|
}
|
|
if c.Flags.Has(1) {
|
|
b.PutInt(c.AdminsCount)
|
|
}
|
|
if c.Flags.Has(2) {
|
|
b.PutInt(c.KickedCount)
|
|
}
|
|
if c.Flags.Has(2) {
|
|
b.PutInt(c.BannedCount)
|
|
}
|
|
if c.Flags.Has(13) {
|
|
b.PutInt(c.OnlineCount)
|
|
}
|
|
b.PutInt(c.ReadInboxMaxID)
|
|
b.PutInt(c.ReadOutboxMaxID)
|
|
b.PutInt(c.UnreadCount)
|
|
if c.ChatPhoto == nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field chat_photo is nil")
|
|
}
|
|
if err := c.ChatPhoto.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field chat_photo: %w", err)
|
|
}
|
|
if err := c.NotifySettings.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field notify_settings: %w", err)
|
|
}
|
|
if c.Flags.Has(23) {
|
|
if c.ExportedInvite == nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field exported_invite is nil")
|
|
}
|
|
if err := c.ExportedInvite.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field exported_invite: %w", err)
|
|
}
|
|
}
|
|
b.PutVectorHeader(len(c.BotInfo))
|
|
for idx, v := range c.BotInfo {
|
|
if err := v.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field bot_info element with index %d: %w", idx, err)
|
|
}
|
|
}
|
|
if c.Flags.Has(4) {
|
|
b.PutLong(c.MigratedFromChatID)
|
|
}
|
|
if c.Flags.Has(4) {
|
|
b.PutInt(c.MigratedFromMaxID)
|
|
}
|
|
if c.Flags.Has(5) {
|
|
b.PutInt(c.PinnedMsgID)
|
|
}
|
|
if c.Flags.Has(8) {
|
|
if err := c.Stickerset.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field stickerset: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(9) {
|
|
b.PutInt(c.AvailableMinID)
|
|
}
|
|
if c.Flags.Has(11) {
|
|
b.PutInt(c.FolderID)
|
|
}
|
|
if c.Flags.Has(14) {
|
|
b.PutLong(c.LinkedChatID)
|
|
}
|
|
if c.Flags.Has(15) {
|
|
if c.Location == nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field location is nil")
|
|
}
|
|
if err := c.Location.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field location: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(17) {
|
|
b.PutInt(c.SlowmodeSeconds)
|
|
}
|
|
if c.Flags.Has(18) {
|
|
b.PutInt(c.SlowmodeNextSendDate)
|
|
}
|
|
if c.Flags.Has(12) {
|
|
b.PutInt(c.StatsDC)
|
|
}
|
|
b.PutInt(c.Pts)
|
|
if c.Flags.Has(21) {
|
|
if c.Call == nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field call is nil")
|
|
}
|
|
if err := c.Call.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field call: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(24) {
|
|
b.PutInt(c.TTLPeriod)
|
|
}
|
|
if c.Flags.Has(25) {
|
|
b.PutVectorHeader(len(c.PendingSuggestions))
|
|
for _, v := range c.PendingSuggestions {
|
|
b.PutString(v)
|
|
}
|
|
}
|
|
if c.Flags.Has(26) {
|
|
if c.GroupcallDefaultJoinAs == nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field groupcall_default_join_as is nil")
|
|
}
|
|
if err := c.GroupcallDefaultJoinAs.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field groupcall_default_join_as: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(27) {
|
|
b.PutString(c.ThemeEmoticon)
|
|
}
|
|
if c.Flags.Has(28) {
|
|
b.PutInt(c.RequestsPending)
|
|
}
|
|
if c.Flags.Has(28) {
|
|
b.PutVectorHeader(len(c.RecentRequesters))
|
|
for _, v := range c.RecentRequesters {
|
|
b.PutLong(v)
|
|
}
|
|
}
|
|
if c.Flags.Has(29) {
|
|
if c.DefaultSendAs == nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field default_send_as is nil")
|
|
}
|
|
if err := c.DefaultSendAs.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field default_send_as: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(30) {
|
|
if c.AvailableReactions == nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field available_reactions is nil")
|
|
}
|
|
if err := c.AvailableReactions.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field available_reactions: %w", err)
|
|
}
|
|
}
|
|
if c.Flags2.Has(13) {
|
|
b.PutInt(c.ReactionsLimit)
|
|
}
|
|
if c.Flags2.Has(4) {
|
|
if err := c.Stories.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field stories: %w", err)
|
|
}
|
|
}
|
|
if c.Flags2.Has(7) {
|
|
if c.Wallpaper == nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field wallpaper is nil")
|
|
}
|
|
if err := c.Wallpaper.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field wallpaper: %w", err)
|
|
}
|
|
}
|
|
if c.Flags2.Has(8) {
|
|
b.PutInt(c.BoostsApplied)
|
|
}
|
|
if c.Flags2.Has(9) {
|
|
b.PutInt(c.BoostsUnrestrict)
|
|
}
|
|
if c.Flags2.Has(10) {
|
|
if err := c.Emojiset.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field emojiset: %w", err)
|
|
}
|
|
}
|
|
if c.Flags2.Has(17) {
|
|
if err := c.BotVerification.Encode(b); err != nil {
|
|
return fmt.Errorf("unable to encode channelFull#52d6806b: field bot_verification: %w", err)
|
|
}
|
|
}
|
|
if c.Flags2.Has(18) {
|
|
b.PutInt(c.StargiftsCount)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Decode implements bin.Decoder.
|
|
func (c *ChannelFull) Decode(b *bin.Buffer) error {
|
|
if c == nil {
|
|
return fmt.Errorf("can't decode channelFull#52d6806b to nil")
|
|
}
|
|
if err := b.ConsumeID(ChannelFullTypeID); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: %w", err)
|
|
}
|
|
return c.DecodeBare(b)
|
|
}
|
|
|
|
// DecodeBare implements bin.BareDecoder.
|
|
func (c *ChannelFull) DecodeBare(b *bin.Buffer) error {
|
|
if c == nil {
|
|
return fmt.Errorf("can't decode channelFull#52d6806b to nil")
|
|
}
|
|
{
|
|
if err := c.Flags.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field flags: %w", err)
|
|
}
|
|
}
|
|
c.CanViewParticipants = c.Flags.Has(3)
|
|
c.CanSetUsername = c.Flags.Has(6)
|
|
c.CanSetStickers = c.Flags.Has(7)
|
|
c.HiddenPrehistory = c.Flags.Has(10)
|
|
c.CanSetLocation = c.Flags.Has(16)
|
|
c.HasScheduled = c.Flags.Has(19)
|
|
c.CanViewStats = c.Flags.Has(20)
|
|
c.Blocked = c.Flags.Has(22)
|
|
{
|
|
if err := c.Flags2.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field flags2: %w", err)
|
|
}
|
|
}
|
|
c.CanDeleteChannel = c.Flags2.Has(0)
|
|
c.Antispam = c.Flags2.Has(1)
|
|
c.ParticipantsHidden = c.Flags2.Has(2)
|
|
c.TranslationsDisabled = c.Flags2.Has(3)
|
|
c.StoriesPinnedAvailable = c.Flags2.Has(5)
|
|
c.ViewForumAsMessages = c.Flags2.Has(6)
|
|
c.RestrictedSponsored = c.Flags2.Has(11)
|
|
c.CanViewRevenue = c.Flags2.Has(12)
|
|
c.PaidMediaAllowed = c.Flags2.Has(14)
|
|
c.CanViewStarsRevenue = c.Flags2.Has(15)
|
|
c.PaidReactionsAvailable = c.Flags2.Has(16)
|
|
c.StargiftsAvailable = c.Flags2.Has(19)
|
|
c.PaidMessagesAvailable = c.Flags2.Has(20)
|
|
{
|
|
value, err := b.Long()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field id: %w", err)
|
|
}
|
|
c.ID = value
|
|
}
|
|
{
|
|
value, err := b.String()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field about: %w", err)
|
|
}
|
|
c.About = value
|
|
}
|
|
if c.Flags.Has(0) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field participants_count: %w", err)
|
|
}
|
|
c.ParticipantsCount = value
|
|
}
|
|
if c.Flags.Has(1) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field admins_count: %w", err)
|
|
}
|
|
c.AdminsCount = value
|
|
}
|
|
if c.Flags.Has(2) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field kicked_count: %w", err)
|
|
}
|
|
c.KickedCount = value
|
|
}
|
|
if c.Flags.Has(2) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field banned_count: %w", err)
|
|
}
|
|
c.BannedCount = value
|
|
}
|
|
if c.Flags.Has(13) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field online_count: %w", err)
|
|
}
|
|
c.OnlineCount = value
|
|
}
|
|
{
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field read_inbox_max_id: %w", err)
|
|
}
|
|
c.ReadInboxMaxID = value
|
|
}
|
|
{
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field read_outbox_max_id: %w", err)
|
|
}
|
|
c.ReadOutboxMaxID = value
|
|
}
|
|
{
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field unread_count: %w", err)
|
|
}
|
|
c.UnreadCount = value
|
|
}
|
|
{
|
|
value, err := DecodePhoto(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field chat_photo: %w", err)
|
|
}
|
|
c.ChatPhoto = value
|
|
}
|
|
{
|
|
if err := c.NotifySettings.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field notify_settings: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(23) {
|
|
value, err := DecodeExportedChatInvite(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field exported_invite: %w", err)
|
|
}
|
|
c.ExportedInvite = value
|
|
}
|
|
{
|
|
headerLen, err := b.VectorHeader()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field bot_info: %w", err)
|
|
}
|
|
|
|
if headerLen > 0 {
|
|
c.BotInfo = make([]BotInfo, 0, headerLen%bin.PreallocateLimit)
|
|
}
|
|
for idx := 0; idx < headerLen; idx++ {
|
|
var value BotInfo
|
|
if err := value.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field bot_info: %w", err)
|
|
}
|
|
c.BotInfo = append(c.BotInfo, value)
|
|
}
|
|
}
|
|
if c.Flags.Has(4) {
|
|
value, err := b.Long()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field migrated_from_chat_id: %w", err)
|
|
}
|
|
c.MigratedFromChatID = value
|
|
}
|
|
if c.Flags.Has(4) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field migrated_from_max_id: %w", err)
|
|
}
|
|
c.MigratedFromMaxID = value
|
|
}
|
|
if c.Flags.Has(5) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field pinned_msg_id: %w", err)
|
|
}
|
|
c.PinnedMsgID = value
|
|
}
|
|
if c.Flags.Has(8) {
|
|
if err := c.Stickerset.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field stickerset: %w", err)
|
|
}
|
|
}
|
|
if c.Flags.Has(9) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field available_min_id: %w", err)
|
|
}
|
|
c.AvailableMinID = value
|
|
}
|
|
if c.Flags.Has(11) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field folder_id: %w", err)
|
|
}
|
|
c.FolderID = value
|
|
}
|
|
if c.Flags.Has(14) {
|
|
value, err := b.Long()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field linked_chat_id: %w", err)
|
|
}
|
|
c.LinkedChatID = value
|
|
}
|
|
if c.Flags.Has(15) {
|
|
value, err := DecodeChannelLocation(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field location: %w", err)
|
|
}
|
|
c.Location = value
|
|
}
|
|
if c.Flags.Has(17) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field slowmode_seconds: %w", err)
|
|
}
|
|
c.SlowmodeSeconds = value
|
|
}
|
|
if c.Flags.Has(18) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field slowmode_next_send_date: %w", err)
|
|
}
|
|
c.SlowmodeNextSendDate = value
|
|
}
|
|
if c.Flags.Has(12) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field stats_dc: %w", err)
|
|
}
|
|
c.StatsDC = value
|
|
}
|
|
{
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field pts: %w", err)
|
|
}
|
|
c.Pts = value
|
|
}
|
|
if c.Flags.Has(21) {
|
|
value, err := DecodeInputGroupCall(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field call: %w", err)
|
|
}
|
|
c.Call = value
|
|
}
|
|
if c.Flags.Has(24) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field ttl_period: %w", err)
|
|
}
|
|
c.TTLPeriod = value
|
|
}
|
|
if c.Flags.Has(25) {
|
|
headerLen, err := b.VectorHeader()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field pending_suggestions: %w", err)
|
|
}
|
|
|
|
if headerLen > 0 {
|
|
c.PendingSuggestions = make([]string, 0, headerLen%bin.PreallocateLimit)
|
|
}
|
|
for idx := 0; idx < headerLen; idx++ {
|
|
value, err := b.String()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field pending_suggestions: %w", err)
|
|
}
|
|
c.PendingSuggestions = append(c.PendingSuggestions, value)
|
|
}
|
|
}
|
|
if c.Flags.Has(26) {
|
|
value, err := DecodePeer(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field groupcall_default_join_as: %w", err)
|
|
}
|
|
c.GroupcallDefaultJoinAs = value
|
|
}
|
|
if c.Flags.Has(27) {
|
|
value, err := b.String()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field theme_emoticon: %w", err)
|
|
}
|
|
c.ThemeEmoticon = value
|
|
}
|
|
if c.Flags.Has(28) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field requests_pending: %w", err)
|
|
}
|
|
c.RequestsPending = value
|
|
}
|
|
if c.Flags.Has(28) {
|
|
headerLen, err := b.VectorHeader()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field recent_requesters: %w", err)
|
|
}
|
|
|
|
if headerLen > 0 {
|
|
c.RecentRequesters = make([]int64, 0, headerLen%bin.PreallocateLimit)
|
|
}
|
|
for idx := 0; idx < headerLen; idx++ {
|
|
value, err := b.Long()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field recent_requesters: %w", err)
|
|
}
|
|
c.RecentRequesters = append(c.RecentRequesters, value)
|
|
}
|
|
}
|
|
if c.Flags.Has(29) {
|
|
value, err := DecodePeer(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field default_send_as: %w", err)
|
|
}
|
|
c.DefaultSendAs = value
|
|
}
|
|
if c.Flags.Has(30) {
|
|
value, err := DecodeChatReactions(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field available_reactions: %w", err)
|
|
}
|
|
c.AvailableReactions = value
|
|
}
|
|
if c.Flags2.Has(13) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field reactions_limit: %w", err)
|
|
}
|
|
c.ReactionsLimit = value
|
|
}
|
|
if c.Flags2.Has(4) {
|
|
if err := c.Stories.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field stories: %w", err)
|
|
}
|
|
}
|
|
if c.Flags2.Has(7) {
|
|
value, err := DecodeWallPaper(b)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field wallpaper: %w", err)
|
|
}
|
|
c.Wallpaper = value
|
|
}
|
|
if c.Flags2.Has(8) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field boosts_applied: %w", err)
|
|
}
|
|
c.BoostsApplied = value
|
|
}
|
|
if c.Flags2.Has(9) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field boosts_unrestrict: %w", err)
|
|
}
|
|
c.BoostsUnrestrict = value
|
|
}
|
|
if c.Flags2.Has(10) {
|
|
if err := c.Emojiset.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field emojiset: %w", err)
|
|
}
|
|
}
|
|
if c.Flags2.Has(17) {
|
|
if err := c.BotVerification.Decode(b); err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field bot_verification: %w", err)
|
|
}
|
|
}
|
|
if c.Flags2.Has(18) {
|
|
value, err := b.Int()
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode channelFull#52d6806b: field stargifts_count: %w", err)
|
|
}
|
|
c.StargiftsCount = value
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// SetCanViewParticipants sets value of CanViewParticipants conditional field.
|
|
func (c *ChannelFull) SetCanViewParticipants(value bool) {
|
|
if value {
|
|
c.Flags.Set(3)
|
|
c.CanViewParticipants = true
|
|
} else {
|
|
c.Flags.Unset(3)
|
|
c.CanViewParticipants = false
|
|
}
|
|
}
|
|
|
|
// GetCanViewParticipants returns value of CanViewParticipants conditional field.
|
|
func (c *ChannelFull) GetCanViewParticipants() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(3)
|
|
}
|
|
|
|
// SetCanSetUsername sets value of CanSetUsername conditional field.
|
|
func (c *ChannelFull) SetCanSetUsername(value bool) {
|
|
if value {
|
|
c.Flags.Set(6)
|
|
c.CanSetUsername = true
|
|
} else {
|
|
c.Flags.Unset(6)
|
|
c.CanSetUsername = false
|
|
}
|
|
}
|
|
|
|
// GetCanSetUsername returns value of CanSetUsername conditional field.
|
|
func (c *ChannelFull) GetCanSetUsername() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(6)
|
|
}
|
|
|
|
// SetCanSetStickers sets value of CanSetStickers conditional field.
|
|
func (c *ChannelFull) SetCanSetStickers(value bool) {
|
|
if value {
|
|
c.Flags.Set(7)
|
|
c.CanSetStickers = true
|
|
} else {
|
|
c.Flags.Unset(7)
|
|
c.CanSetStickers = false
|
|
}
|
|
}
|
|
|
|
// GetCanSetStickers returns value of CanSetStickers conditional field.
|
|
func (c *ChannelFull) GetCanSetStickers() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(7)
|
|
}
|
|
|
|
// SetHiddenPrehistory sets value of HiddenPrehistory conditional field.
|
|
func (c *ChannelFull) SetHiddenPrehistory(value bool) {
|
|
if value {
|
|
c.Flags.Set(10)
|
|
c.HiddenPrehistory = true
|
|
} else {
|
|
c.Flags.Unset(10)
|
|
c.HiddenPrehistory = false
|
|
}
|
|
}
|
|
|
|
// GetHiddenPrehistory returns value of HiddenPrehistory conditional field.
|
|
func (c *ChannelFull) GetHiddenPrehistory() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(10)
|
|
}
|
|
|
|
// SetCanSetLocation sets value of CanSetLocation conditional field.
|
|
func (c *ChannelFull) SetCanSetLocation(value bool) {
|
|
if value {
|
|
c.Flags.Set(16)
|
|
c.CanSetLocation = true
|
|
} else {
|
|
c.Flags.Unset(16)
|
|
c.CanSetLocation = false
|
|
}
|
|
}
|
|
|
|
// GetCanSetLocation returns value of CanSetLocation conditional field.
|
|
func (c *ChannelFull) GetCanSetLocation() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(16)
|
|
}
|
|
|
|
// SetHasScheduled sets value of HasScheduled conditional field.
|
|
func (c *ChannelFull) SetHasScheduled(value bool) {
|
|
if value {
|
|
c.Flags.Set(19)
|
|
c.HasScheduled = true
|
|
} else {
|
|
c.Flags.Unset(19)
|
|
c.HasScheduled = false
|
|
}
|
|
}
|
|
|
|
// GetHasScheduled returns value of HasScheduled conditional field.
|
|
func (c *ChannelFull) GetHasScheduled() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(19)
|
|
}
|
|
|
|
// SetCanViewStats sets value of CanViewStats conditional field.
|
|
func (c *ChannelFull) SetCanViewStats(value bool) {
|
|
if value {
|
|
c.Flags.Set(20)
|
|
c.CanViewStats = true
|
|
} else {
|
|
c.Flags.Unset(20)
|
|
c.CanViewStats = false
|
|
}
|
|
}
|
|
|
|
// GetCanViewStats returns value of CanViewStats conditional field.
|
|
func (c *ChannelFull) GetCanViewStats() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(20)
|
|
}
|
|
|
|
// SetBlocked sets value of Blocked conditional field.
|
|
func (c *ChannelFull) SetBlocked(value bool) {
|
|
if value {
|
|
c.Flags.Set(22)
|
|
c.Blocked = true
|
|
} else {
|
|
c.Flags.Unset(22)
|
|
c.Blocked = false
|
|
}
|
|
}
|
|
|
|
// GetBlocked returns value of Blocked conditional field.
|
|
func (c *ChannelFull) GetBlocked() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags.Has(22)
|
|
}
|
|
|
|
// SetCanDeleteChannel sets value of CanDeleteChannel conditional field.
|
|
func (c *ChannelFull) SetCanDeleteChannel(value bool) {
|
|
if value {
|
|
c.Flags2.Set(0)
|
|
c.CanDeleteChannel = true
|
|
} else {
|
|
c.Flags2.Unset(0)
|
|
c.CanDeleteChannel = false
|
|
}
|
|
}
|
|
|
|
// GetCanDeleteChannel returns value of CanDeleteChannel conditional field.
|
|
func (c *ChannelFull) GetCanDeleteChannel() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(0)
|
|
}
|
|
|
|
// SetAntispam sets value of Antispam conditional field.
|
|
func (c *ChannelFull) SetAntispam(value bool) {
|
|
if value {
|
|
c.Flags2.Set(1)
|
|
c.Antispam = true
|
|
} else {
|
|
c.Flags2.Unset(1)
|
|
c.Antispam = false
|
|
}
|
|
}
|
|
|
|
// GetAntispam returns value of Antispam conditional field.
|
|
func (c *ChannelFull) GetAntispam() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(1)
|
|
}
|
|
|
|
// SetParticipantsHidden sets value of ParticipantsHidden conditional field.
|
|
func (c *ChannelFull) SetParticipantsHidden(value bool) {
|
|
if value {
|
|
c.Flags2.Set(2)
|
|
c.ParticipantsHidden = true
|
|
} else {
|
|
c.Flags2.Unset(2)
|
|
c.ParticipantsHidden = false
|
|
}
|
|
}
|
|
|
|
// GetParticipantsHidden returns value of ParticipantsHidden conditional field.
|
|
func (c *ChannelFull) GetParticipantsHidden() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(2)
|
|
}
|
|
|
|
// SetTranslationsDisabled sets value of TranslationsDisabled conditional field.
|
|
func (c *ChannelFull) SetTranslationsDisabled(value bool) {
|
|
if value {
|
|
c.Flags2.Set(3)
|
|
c.TranslationsDisabled = true
|
|
} else {
|
|
c.Flags2.Unset(3)
|
|
c.TranslationsDisabled = false
|
|
}
|
|
}
|
|
|
|
// GetTranslationsDisabled returns value of TranslationsDisabled conditional field.
|
|
func (c *ChannelFull) GetTranslationsDisabled() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(3)
|
|
}
|
|
|
|
// SetStoriesPinnedAvailable sets value of StoriesPinnedAvailable conditional field.
|
|
func (c *ChannelFull) SetStoriesPinnedAvailable(value bool) {
|
|
if value {
|
|
c.Flags2.Set(5)
|
|
c.StoriesPinnedAvailable = true
|
|
} else {
|
|
c.Flags2.Unset(5)
|
|
c.StoriesPinnedAvailable = false
|
|
}
|
|
}
|
|
|
|
// GetStoriesPinnedAvailable returns value of StoriesPinnedAvailable conditional field.
|
|
func (c *ChannelFull) GetStoriesPinnedAvailable() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(5)
|
|
}
|
|
|
|
// SetViewForumAsMessages sets value of ViewForumAsMessages conditional field.
|
|
func (c *ChannelFull) SetViewForumAsMessages(value bool) {
|
|
if value {
|
|
c.Flags2.Set(6)
|
|
c.ViewForumAsMessages = true
|
|
} else {
|
|
c.Flags2.Unset(6)
|
|
c.ViewForumAsMessages = false
|
|
}
|
|
}
|
|
|
|
// GetViewForumAsMessages returns value of ViewForumAsMessages conditional field.
|
|
func (c *ChannelFull) GetViewForumAsMessages() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(6)
|
|
}
|
|
|
|
// SetRestrictedSponsored sets value of RestrictedSponsored conditional field.
|
|
func (c *ChannelFull) SetRestrictedSponsored(value bool) {
|
|
if value {
|
|
c.Flags2.Set(11)
|
|
c.RestrictedSponsored = true
|
|
} else {
|
|
c.Flags2.Unset(11)
|
|
c.RestrictedSponsored = false
|
|
}
|
|
}
|
|
|
|
// GetRestrictedSponsored returns value of RestrictedSponsored conditional field.
|
|
func (c *ChannelFull) GetRestrictedSponsored() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(11)
|
|
}
|
|
|
|
// SetCanViewRevenue sets value of CanViewRevenue conditional field.
|
|
func (c *ChannelFull) SetCanViewRevenue(value bool) {
|
|
if value {
|
|
c.Flags2.Set(12)
|
|
c.CanViewRevenue = true
|
|
} else {
|
|
c.Flags2.Unset(12)
|
|
c.CanViewRevenue = false
|
|
}
|
|
}
|
|
|
|
// GetCanViewRevenue returns value of CanViewRevenue conditional field.
|
|
func (c *ChannelFull) GetCanViewRevenue() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(12)
|
|
}
|
|
|
|
// SetPaidMediaAllowed sets value of PaidMediaAllowed conditional field.
|
|
func (c *ChannelFull) SetPaidMediaAllowed(value bool) {
|
|
if value {
|
|
c.Flags2.Set(14)
|
|
c.PaidMediaAllowed = true
|
|
} else {
|
|
c.Flags2.Unset(14)
|
|
c.PaidMediaAllowed = false
|
|
}
|
|
}
|
|
|
|
// GetPaidMediaAllowed returns value of PaidMediaAllowed conditional field.
|
|
func (c *ChannelFull) GetPaidMediaAllowed() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(14)
|
|
}
|
|
|
|
// SetCanViewStarsRevenue sets value of CanViewStarsRevenue conditional field.
|
|
func (c *ChannelFull) SetCanViewStarsRevenue(value bool) {
|
|
if value {
|
|
c.Flags2.Set(15)
|
|
c.CanViewStarsRevenue = true
|
|
} else {
|
|
c.Flags2.Unset(15)
|
|
c.CanViewStarsRevenue = false
|
|
}
|
|
}
|
|
|
|
// GetCanViewStarsRevenue returns value of CanViewStarsRevenue conditional field.
|
|
func (c *ChannelFull) GetCanViewStarsRevenue() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(15)
|
|
}
|
|
|
|
// SetPaidReactionsAvailable sets value of PaidReactionsAvailable conditional field.
|
|
func (c *ChannelFull) SetPaidReactionsAvailable(value bool) {
|
|
if value {
|
|
c.Flags2.Set(16)
|
|
c.PaidReactionsAvailable = true
|
|
} else {
|
|
c.Flags2.Unset(16)
|
|
c.PaidReactionsAvailable = false
|
|
}
|
|
}
|
|
|
|
// GetPaidReactionsAvailable returns value of PaidReactionsAvailable conditional field.
|
|
func (c *ChannelFull) GetPaidReactionsAvailable() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(16)
|
|
}
|
|
|
|
// SetStargiftsAvailable sets value of StargiftsAvailable conditional field.
|
|
func (c *ChannelFull) SetStargiftsAvailable(value bool) {
|
|
if value {
|
|
c.Flags2.Set(19)
|
|
c.StargiftsAvailable = true
|
|
} else {
|
|
c.Flags2.Unset(19)
|
|
c.StargiftsAvailable = false
|
|
}
|
|
}
|
|
|
|
// GetStargiftsAvailable returns value of StargiftsAvailable conditional field.
|
|
func (c *ChannelFull) GetStargiftsAvailable() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(19)
|
|
}
|
|
|
|
// SetPaidMessagesAvailable sets value of PaidMessagesAvailable conditional field.
|
|
func (c *ChannelFull) SetPaidMessagesAvailable(value bool) {
|
|
if value {
|
|
c.Flags2.Set(20)
|
|
c.PaidMessagesAvailable = true
|
|
} else {
|
|
c.Flags2.Unset(20)
|
|
c.PaidMessagesAvailable = false
|
|
}
|
|
}
|
|
|
|
// GetPaidMessagesAvailable returns value of PaidMessagesAvailable conditional field.
|
|
func (c *ChannelFull) GetPaidMessagesAvailable() (value bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Flags2.Has(20)
|
|
}
|
|
|
|
// GetID returns value of ID field.
|
|
func (c *ChannelFull) GetID() (value int64) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.ID
|
|
}
|
|
|
|
// GetAbout returns value of About field.
|
|
func (c *ChannelFull) GetAbout() (value string) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.About
|
|
}
|
|
|
|
// SetParticipantsCount sets value of ParticipantsCount conditional field.
|
|
func (c *ChannelFull) SetParticipantsCount(value int) {
|
|
c.Flags.Set(0)
|
|
c.ParticipantsCount = value
|
|
}
|
|
|
|
// GetParticipantsCount returns value of ParticipantsCount conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetParticipantsCount() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(0) {
|
|
return value, false
|
|
}
|
|
return c.ParticipantsCount, true
|
|
}
|
|
|
|
// SetAdminsCount sets value of AdminsCount conditional field.
|
|
func (c *ChannelFull) SetAdminsCount(value int) {
|
|
c.Flags.Set(1)
|
|
c.AdminsCount = value
|
|
}
|
|
|
|
// GetAdminsCount returns value of AdminsCount conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetAdminsCount() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(1) {
|
|
return value, false
|
|
}
|
|
return c.AdminsCount, true
|
|
}
|
|
|
|
// SetKickedCount sets value of KickedCount conditional field.
|
|
func (c *ChannelFull) SetKickedCount(value int) {
|
|
c.Flags.Set(2)
|
|
c.KickedCount = value
|
|
}
|
|
|
|
// GetKickedCount returns value of KickedCount conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetKickedCount() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(2) {
|
|
return value, false
|
|
}
|
|
return c.KickedCount, true
|
|
}
|
|
|
|
// SetBannedCount sets value of BannedCount conditional field.
|
|
func (c *ChannelFull) SetBannedCount(value int) {
|
|
c.Flags.Set(2)
|
|
c.BannedCount = value
|
|
}
|
|
|
|
// GetBannedCount returns value of BannedCount conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetBannedCount() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(2) {
|
|
return value, false
|
|
}
|
|
return c.BannedCount, true
|
|
}
|
|
|
|
// SetOnlineCount sets value of OnlineCount conditional field.
|
|
func (c *ChannelFull) SetOnlineCount(value int) {
|
|
c.Flags.Set(13)
|
|
c.OnlineCount = value
|
|
}
|
|
|
|
// GetOnlineCount returns value of OnlineCount conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetOnlineCount() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(13) {
|
|
return value, false
|
|
}
|
|
return c.OnlineCount, true
|
|
}
|
|
|
|
// GetReadInboxMaxID returns value of ReadInboxMaxID field.
|
|
func (c *ChannelFull) GetReadInboxMaxID() (value int) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.ReadInboxMaxID
|
|
}
|
|
|
|
// GetReadOutboxMaxID returns value of ReadOutboxMaxID field.
|
|
func (c *ChannelFull) GetReadOutboxMaxID() (value int) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.ReadOutboxMaxID
|
|
}
|
|
|
|
// GetUnreadCount returns value of UnreadCount field.
|
|
func (c *ChannelFull) GetUnreadCount() (value int) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.UnreadCount
|
|
}
|
|
|
|
// GetChatPhoto returns value of ChatPhoto field.
|
|
func (c *ChannelFull) GetChatPhoto() (value PhotoClass) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.ChatPhoto
|
|
}
|
|
|
|
// GetNotifySettings returns value of NotifySettings field.
|
|
func (c *ChannelFull) GetNotifySettings() (value PeerNotifySettings) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.NotifySettings
|
|
}
|
|
|
|
// SetExportedInvite sets value of ExportedInvite conditional field.
|
|
func (c *ChannelFull) SetExportedInvite(value ExportedChatInviteClass) {
|
|
c.Flags.Set(23)
|
|
c.ExportedInvite = value
|
|
}
|
|
|
|
// GetExportedInvite returns value of ExportedInvite conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetExportedInvite() (value ExportedChatInviteClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(23) {
|
|
return value, false
|
|
}
|
|
return c.ExportedInvite, true
|
|
}
|
|
|
|
// GetBotInfo returns value of BotInfo field.
|
|
func (c *ChannelFull) GetBotInfo() (value []BotInfo) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.BotInfo
|
|
}
|
|
|
|
// SetMigratedFromChatID sets value of MigratedFromChatID conditional field.
|
|
func (c *ChannelFull) SetMigratedFromChatID(value int64) {
|
|
c.Flags.Set(4)
|
|
c.MigratedFromChatID = value
|
|
}
|
|
|
|
// GetMigratedFromChatID returns value of MigratedFromChatID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetMigratedFromChatID() (value int64, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(4) {
|
|
return value, false
|
|
}
|
|
return c.MigratedFromChatID, true
|
|
}
|
|
|
|
// SetMigratedFromMaxID sets value of MigratedFromMaxID conditional field.
|
|
func (c *ChannelFull) SetMigratedFromMaxID(value int) {
|
|
c.Flags.Set(4)
|
|
c.MigratedFromMaxID = value
|
|
}
|
|
|
|
// GetMigratedFromMaxID returns value of MigratedFromMaxID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetMigratedFromMaxID() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(4) {
|
|
return value, false
|
|
}
|
|
return c.MigratedFromMaxID, true
|
|
}
|
|
|
|
// SetPinnedMsgID sets value of PinnedMsgID conditional field.
|
|
func (c *ChannelFull) SetPinnedMsgID(value int) {
|
|
c.Flags.Set(5)
|
|
c.PinnedMsgID = value
|
|
}
|
|
|
|
// GetPinnedMsgID returns value of PinnedMsgID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetPinnedMsgID() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(5) {
|
|
return value, false
|
|
}
|
|
return c.PinnedMsgID, true
|
|
}
|
|
|
|
// SetStickerset sets value of Stickerset conditional field.
|
|
func (c *ChannelFull) SetStickerset(value StickerSet) {
|
|
c.Flags.Set(8)
|
|
c.Stickerset = value
|
|
}
|
|
|
|
// GetStickerset returns value of Stickerset conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetStickerset() (value StickerSet, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(8) {
|
|
return value, false
|
|
}
|
|
return c.Stickerset, true
|
|
}
|
|
|
|
// SetAvailableMinID sets value of AvailableMinID conditional field.
|
|
func (c *ChannelFull) SetAvailableMinID(value int) {
|
|
c.Flags.Set(9)
|
|
c.AvailableMinID = value
|
|
}
|
|
|
|
// GetAvailableMinID returns value of AvailableMinID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetAvailableMinID() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(9) {
|
|
return value, false
|
|
}
|
|
return c.AvailableMinID, true
|
|
}
|
|
|
|
// SetFolderID sets value of FolderID conditional field.
|
|
func (c *ChannelFull) SetFolderID(value int) {
|
|
c.Flags.Set(11)
|
|
c.FolderID = value
|
|
}
|
|
|
|
// GetFolderID returns value of FolderID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetFolderID() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(11) {
|
|
return value, false
|
|
}
|
|
return c.FolderID, true
|
|
}
|
|
|
|
// SetLinkedChatID sets value of LinkedChatID conditional field.
|
|
func (c *ChannelFull) SetLinkedChatID(value int64) {
|
|
c.Flags.Set(14)
|
|
c.LinkedChatID = value
|
|
}
|
|
|
|
// GetLinkedChatID returns value of LinkedChatID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetLinkedChatID() (value int64, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(14) {
|
|
return value, false
|
|
}
|
|
return c.LinkedChatID, true
|
|
}
|
|
|
|
// SetLocation sets value of Location conditional field.
|
|
func (c *ChannelFull) SetLocation(value ChannelLocationClass) {
|
|
c.Flags.Set(15)
|
|
c.Location = value
|
|
}
|
|
|
|
// GetLocation returns value of Location conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetLocation() (value ChannelLocationClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(15) {
|
|
return value, false
|
|
}
|
|
return c.Location, true
|
|
}
|
|
|
|
// SetSlowmodeSeconds sets value of SlowmodeSeconds conditional field.
|
|
func (c *ChannelFull) SetSlowmodeSeconds(value int) {
|
|
c.Flags.Set(17)
|
|
c.SlowmodeSeconds = value
|
|
}
|
|
|
|
// GetSlowmodeSeconds returns value of SlowmodeSeconds conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetSlowmodeSeconds() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(17) {
|
|
return value, false
|
|
}
|
|
return c.SlowmodeSeconds, true
|
|
}
|
|
|
|
// SetSlowmodeNextSendDate sets value of SlowmodeNextSendDate conditional field.
|
|
func (c *ChannelFull) SetSlowmodeNextSendDate(value int) {
|
|
c.Flags.Set(18)
|
|
c.SlowmodeNextSendDate = value
|
|
}
|
|
|
|
// GetSlowmodeNextSendDate returns value of SlowmodeNextSendDate conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetSlowmodeNextSendDate() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(18) {
|
|
return value, false
|
|
}
|
|
return c.SlowmodeNextSendDate, true
|
|
}
|
|
|
|
// SetStatsDC sets value of StatsDC conditional field.
|
|
func (c *ChannelFull) SetStatsDC(value int) {
|
|
c.Flags.Set(12)
|
|
c.StatsDC = value
|
|
}
|
|
|
|
// GetStatsDC returns value of StatsDC conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetStatsDC() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(12) {
|
|
return value, false
|
|
}
|
|
return c.StatsDC, true
|
|
}
|
|
|
|
// GetPts returns value of Pts field.
|
|
func (c *ChannelFull) GetPts() (value int) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
return c.Pts
|
|
}
|
|
|
|
// SetCall sets value of Call conditional field.
|
|
func (c *ChannelFull) SetCall(value InputGroupCallClass) {
|
|
c.Flags.Set(21)
|
|
c.Call = value
|
|
}
|
|
|
|
// GetCall returns value of Call conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetCall() (value InputGroupCallClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(21) {
|
|
return value, false
|
|
}
|
|
return c.Call, true
|
|
}
|
|
|
|
// SetTTLPeriod sets value of TTLPeriod conditional field.
|
|
func (c *ChannelFull) SetTTLPeriod(value int) {
|
|
c.Flags.Set(24)
|
|
c.TTLPeriod = value
|
|
}
|
|
|
|
// GetTTLPeriod returns value of TTLPeriod conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetTTLPeriod() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(24) {
|
|
return value, false
|
|
}
|
|
return c.TTLPeriod, true
|
|
}
|
|
|
|
// SetPendingSuggestions sets value of PendingSuggestions conditional field.
|
|
func (c *ChannelFull) SetPendingSuggestions(value []string) {
|
|
c.Flags.Set(25)
|
|
c.PendingSuggestions = value
|
|
}
|
|
|
|
// GetPendingSuggestions returns value of PendingSuggestions conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetPendingSuggestions() (value []string, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(25) {
|
|
return value, false
|
|
}
|
|
return c.PendingSuggestions, true
|
|
}
|
|
|
|
// SetGroupcallDefaultJoinAs sets value of GroupcallDefaultJoinAs conditional field.
|
|
func (c *ChannelFull) SetGroupcallDefaultJoinAs(value PeerClass) {
|
|
c.Flags.Set(26)
|
|
c.GroupcallDefaultJoinAs = value
|
|
}
|
|
|
|
// GetGroupcallDefaultJoinAs returns value of GroupcallDefaultJoinAs conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetGroupcallDefaultJoinAs() (value PeerClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(26) {
|
|
return value, false
|
|
}
|
|
return c.GroupcallDefaultJoinAs, true
|
|
}
|
|
|
|
// SetThemeEmoticon sets value of ThemeEmoticon conditional field.
|
|
func (c *ChannelFull) SetThemeEmoticon(value string) {
|
|
c.Flags.Set(27)
|
|
c.ThemeEmoticon = value
|
|
}
|
|
|
|
// GetThemeEmoticon returns value of ThemeEmoticon conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetThemeEmoticon() (value string, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(27) {
|
|
return value, false
|
|
}
|
|
return c.ThemeEmoticon, true
|
|
}
|
|
|
|
// SetRequestsPending sets value of RequestsPending conditional field.
|
|
func (c *ChannelFull) SetRequestsPending(value int) {
|
|
c.Flags.Set(28)
|
|
c.RequestsPending = value
|
|
}
|
|
|
|
// GetRequestsPending returns value of RequestsPending conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetRequestsPending() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(28) {
|
|
return value, false
|
|
}
|
|
return c.RequestsPending, true
|
|
}
|
|
|
|
// SetRecentRequesters sets value of RecentRequesters conditional field.
|
|
func (c *ChannelFull) SetRecentRequesters(value []int64) {
|
|
c.Flags.Set(28)
|
|
c.RecentRequesters = value
|
|
}
|
|
|
|
// GetRecentRequesters returns value of RecentRequesters conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetRecentRequesters() (value []int64, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(28) {
|
|
return value, false
|
|
}
|
|
return c.RecentRequesters, true
|
|
}
|
|
|
|
// SetDefaultSendAs sets value of DefaultSendAs conditional field.
|
|
func (c *ChannelFull) SetDefaultSendAs(value PeerClass) {
|
|
c.Flags.Set(29)
|
|
c.DefaultSendAs = value
|
|
}
|
|
|
|
// GetDefaultSendAs returns value of DefaultSendAs conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetDefaultSendAs() (value PeerClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(29) {
|
|
return value, false
|
|
}
|
|
return c.DefaultSendAs, true
|
|
}
|
|
|
|
// SetAvailableReactions sets value of AvailableReactions conditional field.
|
|
func (c *ChannelFull) SetAvailableReactions(value ChatReactionsClass) {
|
|
c.Flags.Set(30)
|
|
c.AvailableReactions = value
|
|
}
|
|
|
|
// GetAvailableReactions returns value of AvailableReactions conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetAvailableReactions() (value ChatReactionsClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags.Has(30) {
|
|
return value, false
|
|
}
|
|
return c.AvailableReactions, true
|
|
}
|
|
|
|
// SetReactionsLimit sets value of ReactionsLimit conditional field.
|
|
func (c *ChannelFull) SetReactionsLimit(value int) {
|
|
c.Flags2.Set(13)
|
|
c.ReactionsLimit = value
|
|
}
|
|
|
|
// GetReactionsLimit returns value of ReactionsLimit conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetReactionsLimit() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags2.Has(13) {
|
|
return value, false
|
|
}
|
|
return c.ReactionsLimit, true
|
|
}
|
|
|
|
// SetStories sets value of Stories conditional field.
|
|
func (c *ChannelFull) SetStories(value PeerStories) {
|
|
c.Flags2.Set(4)
|
|
c.Stories = value
|
|
}
|
|
|
|
// GetStories returns value of Stories conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetStories() (value PeerStories, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags2.Has(4) {
|
|
return value, false
|
|
}
|
|
return c.Stories, true
|
|
}
|
|
|
|
// SetWallpaper sets value of Wallpaper conditional field.
|
|
func (c *ChannelFull) SetWallpaper(value WallPaperClass) {
|
|
c.Flags2.Set(7)
|
|
c.Wallpaper = value
|
|
}
|
|
|
|
// GetWallpaper returns value of Wallpaper conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetWallpaper() (value WallPaperClass, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags2.Has(7) {
|
|
return value, false
|
|
}
|
|
return c.Wallpaper, true
|
|
}
|
|
|
|
// SetBoostsApplied sets value of BoostsApplied conditional field.
|
|
func (c *ChannelFull) SetBoostsApplied(value int) {
|
|
c.Flags2.Set(8)
|
|
c.BoostsApplied = value
|
|
}
|
|
|
|
// GetBoostsApplied returns value of BoostsApplied conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetBoostsApplied() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags2.Has(8) {
|
|
return value, false
|
|
}
|
|
return c.BoostsApplied, true
|
|
}
|
|
|
|
// SetBoostsUnrestrict sets value of BoostsUnrestrict conditional field.
|
|
func (c *ChannelFull) SetBoostsUnrestrict(value int) {
|
|
c.Flags2.Set(9)
|
|
c.BoostsUnrestrict = value
|
|
}
|
|
|
|
// GetBoostsUnrestrict returns value of BoostsUnrestrict conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetBoostsUnrestrict() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags2.Has(9) {
|
|
return value, false
|
|
}
|
|
return c.BoostsUnrestrict, true
|
|
}
|
|
|
|
// SetEmojiset sets value of Emojiset conditional field.
|
|
func (c *ChannelFull) SetEmojiset(value StickerSet) {
|
|
c.Flags2.Set(10)
|
|
c.Emojiset = value
|
|
}
|
|
|
|
// GetEmojiset returns value of Emojiset conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetEmojiset() (value StickerSet, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags2.Has(10) {
|
|
return value, false
|
|
}
|
|
return c.Emojiset, true
|
|
}
|
|
|
|
// SetBotVerification sets value of BotVerification conditional field.
|
|
func (c *ChannelFull) SetBotVerification(value BotVerification) {
|
|
c.Flags2.Set(17)
|
|
c.BotVerification = value
|
|
}
|
|
|
|
// GetBotVerification returns value of BotVerification conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetBotVerification() (value BotVerification, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags2.Has(17) {
|
|
return value, false
|
|
}
|
|
return c.BotVerification, true
|
|
}
|
|
|
|
// SetStargiftsCount sets value of StargiftsCount conditional field.
|
|
func (c *ChannelFull) SetStargiftsCount(value int) {
|
|
c.Flags2.Set(18)
|
|
c.StargiftsCount = value
|
|
}
|
|
|
|
// GetStargiftsCount returns value of StargiftsCount conditional field and
|
|
// boolean which is true if field was set.
|
|
func (c *ChannelFull) GetStargiftsCount() (value int, ok bool) {
|
|
if c == nil {
|
|
return
|
|
}
|
|
if !c.Flags2.Has(18) {
|
|
return value, false
|
|
}
|
|
return c.StargiftsCount, true
|
|
}
|
|
|
|
// ChatFullClassName is schema name of ChatFullClass.
|
|
const ChatFullClassName = "ChatFull"
|
|
|
|
// ChatFullClass represents ChatFull generic type.
|
|
//
|
|
// See https://core.telegram.org/type/ChatFull for reference.
|
|
//
|
|
// Example:
|
|
//
|
|
// g, err := tg.DecodeChatFull(buf)
|
|
// if err != nil {
|
|
// panic(err)
|
|
// }
|
|
// switch v := g.(type) {
|
|
// case *tg.ChatFull: // chatFull#2633421b
|
|
// case *tg.ChannelFull: // channelFull#52d6806b
|
|
// default: panic(v)
|
|
// }
|
|
type ChatFullClass interface {
|
|
bin.Encoder
|
|
bin.Decoder
|
|
bin.BareEncoder
|
|
bin.BareDecoder
|
|
construct() ChatFullClass
|
|
|
|
// TypeID returns type id in TL schema.
|
|
//
|
|
// See https://core.telegram.org/mtproto/TL-tl#remarks.
|
|
TypeID() uint32
|
|
// TypeName returns name of type in TL schema.
|
|
TypeName() string
|
|
// String implements fmt.Stringer.
|
|
String() string
|
|
// Zero returns true if current object has a zero value.
|
|
Zero() bool
|
|
|
|
// Can we change the username of this chat
|
|
GetCanSetUsername() (value bool)
|
|
|
|
// Whether scheduled messages¹ are available
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/scheduled-messages
|
|
GetHasScheduled() (value bool)
|
|
|
|
// Whether the real-time chat translation popup¹ should be hidden.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/translation
|
|
GetTranslationsDisabled() (value bool)
|
|
|
|
// ID of the chat
|
|
GetID() (value int64)
|
|
|
|
// About string for this chat
|
|
GetAbout() (value string)
|
|
|
|
// Notification settings
|
|
GetNotifySettings() (value PeerNotifySettings)
|
|
|
|
// Chat invite
|
|
GetExportedInvite() (value ExportedChatInviteClass, ok bool)
|
|
|
|
// Message ID of the last pinned message¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/pin
|
|
GetPinnedMsgID() (value int, ok bool)
|
|
|
|
// Peer folder ID, for more info click here¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/folders#peer-folders
|
|
GetFolderID() (value int, ok bool)
|
|
|
|
// Group call information
|
|
GetCall() (value InputGroupCallClass, ok bool)
|
|
|
|
// Time-To-Live of messages sent by the current user to this chat
|
|
GetTTLPeriod() (value int, ok bool)
|
|
|
|
// When using phone.getGroupCallJoinAs¹ to get a list of peers that can be used to join
|
|
// a group call, this field indicates the peer that should be selected by default.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/method/phone.getGroupCallJoinAs
|
|
GetGroupcallDefaultJoinAs() (value PeerClass, ok bool)
|
|
|
|
// Emoji representing a specific chat theme
|
|
GetThemeEmoticon() (value string, ok bool)
|
|
|
|
// Pending join requests »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/invites#join-requests
|
|
GetRequestsPending() (value int, ok bool)
|
|
|
|
// IDs of users who requested to join recently
|
|
GetRecentRequesters() (value []int64, ok bool)
|
|
// Allowed message reactions »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/reactions
|
|
GetAvailableReactions() (value ChatReactionsClass, ok bool)
|
|
|
|
// This flag may be used to impose a custom limit of unique reactions (i.e. a
|
|
// customizable version of appConfig.reactions_uniq_max¹).
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/config#reactions-uniq-max
|
|
GetReactionsLimit() (value int, ok bool)
|
|
}
|
|
|
|
// DecodeChatFull implements binary de-serialization for ChatFullClass.
|
|
func DecodeChatFull(buf *bin.Buffer) (ChatFullClass, error) {
|
|
id, err := buf.PeekID()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
switch id {
|
|
case ChatFullTypeID:
|
|
// Decoding chatFull#2633421b.
|
|
v := ChatFull{}
|
|
if err := v.Decode(buf); err != nil {
|
|
return nil, fmt.Errorf("unable to decode ChatFullClass: %w", err)
|
|
}
|
|
return &v, nil
|
|
case ChannelFullTypeID:
|
|
// Decoding channelFull#52d6806b.
|
|
v := ChannelFull{}
|
|
if err := v.Decode(buf); err != nil {
|
|
return nil, fmt.Errorf("unable to decode ChatFullClass: %w", err)
|
|
}
|
|
return &v, nil
|
|
default:
|
|
return nil, fmt.Errorf("unable to decode ChatFullClass: %w", bin.NewUnexpectedID(id))
|
|
}
|
|
}
|
|
|
|
// ChatFull boxes the ChatFullClass providing a helper.
|
|
type ChatFullBox struct {
|
|
ChatFull ChatFullClass
|
|
}
|
|
|
|
// Decode implements bin.Decoder for ChatFullBox.
|
|
func (b *ChatFullBox) Decode(buf *bin.Buffer) error {
|
|
if b == nil {
|
|
return fmt.Errorf("unable to decode ChatFullBox to nil")
|
|
}
|
|
v, err := DecodeChatFull(buf)
|
|
if err != nil {
|
|
return fmt.Errorf("unable to decode boxed value: %w", err)
|
|
}
|
|
b.ChatFull = v
|
|
return nil
|
|
}
|
|
|
|
// Encode implements bin.Encode for ChatFullBox.
|
|
func (b *ChatFullBox) Encode(buf *bin.Buffer) error {
|
|
if b == nil || b.ChatFull == nil {
|
|
return fmt.Errorf("unable to encode ChatFullClass as nil")
|
|
}
|
|
return b.ChatFull.Encode(buf)
|
|
}
|