// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// 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{}
)

// MessageEntityUnknown represents TL type `messageEntityUnknown#bb92ba95`.
// Unknown message entity
//
// See https://core.telegram.org/constructor/messageEntityUnknown for reference.
type MessageEntityUnknown struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityUnknownTypeID is TL type id of MessageEntityUnknown.
const MessageEntityUnknownTypeID = 0xbb92ba95

// construct implements constructor of MessageEntityClass.
func ( MessageEntityUnknown) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityUnknown.
var (
	_ bin.Encoder     = &MessageEntityUnknown{}
	_ bin.Decoder     = &MessageEntityUnknown{}
	_ bin.BareEncoder = &MessageEntityUnknown{}
	_ bin.BareDecoder = &MessageEntityUnknown{}

	_ MessageEntityClass = &MessageEntityUnknown{}
)

func ( *MessageEntityUnknown) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityUnknown) () string {
	if  == nil {
		return "MessageEntityUnknown(nil)"
	}
	type  MessageEntityUnknown
	return fmt.Sprintf("MessageEntityUnknown%+v", (*))
}

// FillFrom fills MessageEntityUnknown from given interface.
func ( *MessageEntityUnknown) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityUnknown) () uint32 {
	return MessageEntityUnknownTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityUnknown) () string {
	return "messageEntityUnknown"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityUnknown) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityUnknown",
		ID:   MessageEntityUnknownTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityUnknown) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityUnknown#bb92ba95 as nil")
	}
	.PutID(MessageEntityUnknownTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityUnknown) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityUnknown#bb92ba95 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityUnknown) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityUnknown#bb92ba95 to nil")
	}
	if  := .ConsumeID(MessageEntityUnknownTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityUnknown#bb92ba95: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityUnknown) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityUnknown#bb92ba95 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityUnknown#bb92ba95: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityUnknown#bb92ba95: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityUnknown) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityUnknown) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityMention represents TL type `messageEntityMention#fa04579d`.
// Message entity mentioningĀ¹ a user by @username; messageEntityMentionNameĀ² can also
// be used to mention users by their ID.
//
// Links:
//  1. https://core.telegram.org/api/mentions
//  2. https://core.telegram.org/constructor/messageEntityMentionName
//
// See https://core.telegram.org/constructor/messageEntityMention for reference.
type MessageEntityMention struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityMentionTypeID is TL type id of MessageEntityMention.
const MessageEntityMentionTypeID = 0xfa04579d

// construct implements constructor of MessageEntityClass.
func ( MessageEntityMention) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityMention.
var (
	_ bin.Encoder     = &MessageEntityMention{}
	_ bin.Decoder     = &MessageEntityMention{}
	_ bin.BareEncoder = &MessageEntityMention{}
	_ bin.BareDecoder = &MessageEntityMention{}

	_ MessageEntityClass = &MessageEntityMention{}
)

func ( *MessageEntityMention) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityMention) () string {
	if  == nil {
		return "MessageEntityMention(nil)"
	}
	type  MessageEntityMention
	return fmt.Sprintf("MessageEntityMention%+v", (*))
}

// FillFrom fills MessageEntityMention from given interface.
func ( *MessageEntityMention) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityMention) () uint32 {
	return MessageEntityMentionTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityMention) () string {
	return "messageEntityMention"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityMention) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityMention",
		ID:   MessageEntityMentionTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityMention) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityMention#fa04579d as nil")
	}
	.PutID(MessageEntityMentionTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityMention) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityMention#fa04579d as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityMention) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityMention#fa04579d to nil")
	}
	if  := .ConsumeID(MessageEntityMentionTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityMention#fa04579d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityMention) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityMention#fa04579d to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityMention#fa04579d: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityMention#fa04579d: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityMention) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityMention) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityHashtag represents TL type `messageEntityHashtag#6f635b0d`.
// #hashtag message entity
//
// See https://core.telegram.org/constructor/messageEntityHashtag for reference.
type MessageEntityHashtag struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityHashtagTypeID is TL type id of MessageEntityHashtag.
const MessageEntityHashtagTypeID = 0x6f635b0d

// construct implements constructor of MessageEntityClass.
func ( MessageEntityHashtag) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityHashtag.
var (
	_ bin.Encoder     = &MessageEntityHashtag{}
	_ bin.Decoder     = &MessageEntityHashtag{}
	_ bin.BareEncoder = &MessageEntityHashtag{}
	_ bin.BareDecoder = &MessageEntityHashtag{}

	_ MessageEntityClass = &MessageEntityHashtag{}
)

func ( *MessageEntityHashtag) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityHashtag) () string {
	if  == nil {
		return "MessageEntityHashtag(nil)"
	}
	type  MessageEntityHashtag
	return fmt.Sprintf("MessageEntityHashtag%+v", (*))
}

// FillFrom fills MessageEntityHashtag from given interface.
func ( *MessageEntityHashtag) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityHashtag) () uint32 {
	return MessageEntityHashtagTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityHashtag) () string {
	return "messageEntityHashtag"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityHashtag) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityHashtag",
		ID:   MessageEntityHashtagTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityHashtag) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityHashtag#6f635b0d as nil")
	}
	.PutID(MessageEntityHashtagTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityHashtag) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityHashtag#6f635b0d as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityHashtag) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityHashtag#6f635b0d to nil")
	}
	if  := .ConsumeID(MessageEntityHashtagTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityHashtag#6f635b0d: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityHashtag) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityHashtag#6f635b0d to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityHashtag#6f635b0d: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityHashtag#6f635b0d: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityHashtag) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityHashtag) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityBotCommand represents TL type `messageEntityBotCommand#6cef8ac7`.
// Message entity representing a bot /command
//
// See https://core.telegram.org/constructor/messageEntityBotCommand for reference.
type MessageEntityBotCommand struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityBotCommandTypeID is TL type id of MessageEntityBotCommand.
const MessageEntityBotCommandTypeID = 0x6cef8ac7

// construct implements constructor of MessageEntityClass.
func ( MessageEntityBotCommand) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityBotCommand.
var (
	_ bin.Encoder     = &MessageEntityBotCommand{}
	_ bin.Decoder     = &MessageEntityBotCommand{}
	_ bin.BareEncoder = &MessageEntityBotCommand{}
	_ bin.BareDecoder = &MessageEntityBotCommand{}

	_ MessageEntityClass = &MessageEntityBotCommand{}
)

func ( *MessageEntityBotCommand) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityBotCommand) () string {
	if  == nil {
		return "MessageEntityBotCommand(nil)"
	}
	type  MessageEntityBotCommand
	return fmt.Sprintf("MessageEntityBotCommand%+v", (*))
}

// FillFrom fills MessageEntityBotCommand from given interface.
func ( *MessageEntityBotCommand) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityBotCommand) () uint32 {
	return MessageEntityBotCommandTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityBotCommand) () string {
	return "messageEntityBotCommand"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityBotCommand) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityBotCommand",
		ID:   MessageEntityBotCommandTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityBotCommand) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityBotCommand#6cef8ac7 as nil")
	}
	.PutID(MessageEntityBotCommandTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityBotCommand) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityBotCommand#6cef8ac7 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityBotCommand) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityBotCommand#6cef8ac7 to nil")
	}
	if  := .ConsumeID(MessageEntityBotCommandTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityBotCommand#6cef8ac7: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityBotCommand) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityBotCommand#6cef8ac7 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityBotCommand#6cef8ac7: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityBotCommand#6cef8ac7: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityBotCommand) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityBotCommand) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityURL represents TL type `messageEntityUrl#6ed02538`.
// Message entity representing an in-text url: https://google.comĀ¹; for text urlsĀ², use
// messageEntityTextUrlĀ³.
//
// Links:
//  1. https://google.com
//  2. https://google.com
//  3. https://core.telegram.org/constructor/messageEntityTextUrl
//
// See https://core.telegram.org/constructor/messageEntityUrl for reference.
type MessageEntityURL struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityURLTypeID is TL type id of MessageEntityURL.
const MessageEntityURLTypeID = 0x6ed02538

// construct implements constructor of MessageEntityClass.
func ( MessageEntityURL) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityURL.
var (
	_ bin.Encoder     = &MessageEntityURL{}
	_ bin.Decoder     = &MessageEntityURL{}
	_ bin.BareEncoder = &MessageEntityURL{}
	_ bin.BareDecoder = &MessageEntityURL{}

	_ MessageEntityClass = &MessageEntityURL{}
)

func ( *MessageEntityURL) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityURL) () string {
	if  == nil {
		return "MessageEntityURL(nil)"
	}
	type  MessageEntityURL
	return fmt.Sprintf("MessageEntityURL%+v", (*))
}

// FillFrom fills MessageEntityURL from given interface.
func ( *MessageEntityURL) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityURL) () uint32 {
	return MessageEntityURLTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityURL) () string {
	return "messageEntityUrl"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityURL) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityUrl",
		ID:   MessageEntityURLTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityUrl#6ed02538 as nil")
	}
	.PutID(MessageEntityURLTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityUrl#6ed02538 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityUrl#6ed02538 to nil")
	}
	if  := .ConsumeID(MessageEntityURLTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityUrl#6ed02538: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityUrl#6ed02538 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityUrl#6ed02538: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityUrl#6ed02538: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityURL) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityURL) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityEmail represents TL type `messageEntityEmail#64e475c2`.
// Message entity representing an email@example.comĀ¹.
//
// Links:
//  1. https://core.telegram.orgmailto:email@example.com
//
// See https://core.telegram.org/constructor/messageEntityEmail for reference.
type MessageEntityEmail struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityEmailTypeID is TL type id of MessageEntityEmail.
const MessageEntityEmailTypeID = 0x64e475c2

// construct implements constructor of MessageEntityClass.
func ( MessageEntityEmail) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityEmail.
var (
	_ bin.Encoder     = &MessageEntityEmail{}
	_ bin.Decoder     = &MessageEntityEmail{}
	_ bin.BareEncoder = &MessageEntityEmail{}
	_ bin.BareDecoder = &MessageEntityEmail{}

	_ MessageEntityClass = &MessageEntityEmail{}
)

func ( *MessageEntityEmail) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityEmail) () string {
	if  == nil {
		return "MessageEntityEmail(nil)"
	}
	type  MessageEntityEmail
	return fmt.Sprintf("MessageEntityEmail%+v", (*))
}

// FillFrom fills MessageEntityEmail from given interface.
func ( *MessageEntityEmail) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityEmail) () uint32 {
	return MessageEntityEmailTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityEmail) () string {
	return "messageEntityEmail"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityEmail) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityEmail",
		ID:   MessageEntityEmailTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityEmail) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityEmail#64e475c2 as nil")
	}
	.PutID(MessageEntityEmailTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityEmail) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityEmail#64e475c2 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityEmail) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityEmail#64e475c2 to nil")
	}
	if  := .ConsumeID(MessageEntityEmailTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityEmail#64e475c2: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityEmail) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityEmail#64e475c2 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityEmail#64e475c2: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityEmail#64e475c2: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityEmail) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityEmail) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityBold represents TL type `messageEntityBold#bd610bc9`.
// Message entity representing bold text.
//
// See https://core.telegram.org/constructor/messageEntityBold for reference.
type MessageEntityBold struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityBoldTypeID is TL type id of MessageEntityBold.
const MessageEntityBoldTypeID = 0xbd610bc9

// construct implements constructor of MessageEntityClass.
func ( MessageEntityBold) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityBold.
var (
	_ bin.Encoder     = &MessageEntityBold{}
	_ bin.Decoder     = &MessageEntityBold{}
	_ bin.BareEncoder = &MessageEntityBold{}
	_ bin.BareDecoder = &MessageEntityBold{}

	_ MessageEntityClass = &MessageEntityBold{}
)

func ( *MessageEntityBold) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityBold) () string {
	if  == nil {
		return "MessageEntityBold(nil)"
	}
	type  MessageEntityBold
	return fmt.Sprintf("MessageEntityBold%+v", (*))
}

// FillFrom fills MessageEntityBold from given interface.
func ( *MessageEntityBold) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityBold) () uint32 {
	return MessageEntityBoldTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityBold) () string {
	return "messageEntityBold"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityBold) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityBold",
		ID:   MessageEntityBoldTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityBold) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityBold#bd610bc9 as nil")
	}
	.PutID(MessageEntityBoldTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityBold) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityBold#bd610bc9 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityBold) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityBold#bd610bc9 to nil")
	}
	if  := .ConsumeID(MessageEntityBoldTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityBold#bd610bc9: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityBold) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityBold#bd610bc9 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityBold#bd610bc9: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityBold#bd610bc9: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityBold) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityBold) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityItalic represents TL type `messageEntityItalic#826f8b60`.
// Message entity representing italic text.
//
// See https://core.telegram.org/constructor/messageEntityItalic for reference.
type MessageEntityItalic struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityItalicTypeID is TL type id of MessageEntityItalic.
const MessageEntityItalicTypeID = 0x826f8b60

// construct implements constructor of MessageEntityClass.
func ( MessageEntityItalic) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityItalic.
var (
	_ bin.Encoder     = &MessageEntityItalic{}
	_ bin.Decoder     = &MessageEntityItalic{}
	_ bin.BareEncoder = &MessageEntityItalic{}
	_ bin.BareDecoder = &MessageEntityItalic{}

	_ MessageEntityClass = &MessageEntityItalic{}
)

func ( *MessageEntityItalic) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityItalic) () string {
	if  == nil {
		return "MessageEntityItalic(nil)"
	}
	type  MessageEntityItalic
	return fmt.Sprintf("MessageEntityItalic%+v", (*))
}

// FillFrom fills MessageEntityItalic from given interface.
func ( *MessageEntityItalic) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityItalic) () uint32 {
	return MessageEntityItalicTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityItalic) () string {
	return "messageEntityItalic"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityItalic) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityItalic",
		ID:   MessageEntityItalicTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityItalic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityItalic#826f8b60 as nil")
	}
	.PutID(MessageEntityItalicTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityItalic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityItalic#826f8b60 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityItalic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityItalic#826f8b60 to nil")
	}
	if  := .ConsumeID(MessageEntityItalicTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityItalic#826f8b60: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityItalic) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityItalic#826f8b60 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityItalic#826f8b60: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityItalic#826f8b60: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityItalic) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityItalic) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityCode represents TL type `messageEntityCode#28a20571`.
// Message entity representing a codeblock.
//
// See https://core.telegram.org/constructor/messageEntityCode for reference.
type MessageEntityCode struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityCodeTypeID is TL type id of MessageEntityCode.
const MessageEntityCodeTypeID = 0x28a20571

// construct implements constructor of MessageEntityClass.
func ( MessageEntityCode) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityCode.
var (
	_ bin.Encoder     = &MessageEntityCode{}
	_ bin.Decoder     = &MessageEntityCode{}
	_ bin.BareEncoder = &MessageEntityCode{}
	_ bin.BareDecoder = &MessageEntityCode{}

	_ MessageEntityClass = &MessageEntityCode{}
)

func ( *MessageEntityCode) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityCode) () string {
	if  == nil {
		return "MessageEntityCode(nil)"
	}
	type  MessageEntityCode
	return fmt.Sprintf("MessageEntityCode%+v", (*))
}

// FillFrom fills MessageEntityCode from given interface.
func ( *MessageEntityCode) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityCode) () uint32 {
	return MessageEntityCodeTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityCode) () string {
	return "messageEntityCode"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityCode) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityCode",
		ID:   MessageEntityCodeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityCode#28a20571 as nil")
	}
	.PutID(MessageEntityCodeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityCode#28a20571 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityCode#28a20571 to nil")
	}
	if  := .ConsumeID(MessageEntityCodeTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityCode#28a20571: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityCode) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityCode#28a20571 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityCode#28a20571: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityCode#28a20571: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityCode) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityCode) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityPre represents TL type `messageEntityPre#73924be0`.
// Message entity representing a preformatted codeblock, allowing the user to specify a
// programming language for the codeblock.
//
// See https://core.telegram.org/constructor/messageEntityPre for reference.
type MessageEntityPre struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
	// Programming language of the code
	Language string
}

// MessageEntityPreTypeID is TL type id of MessageEntityPre.
const MessageEntityPreTypeID = 0x73924be0

// construct implements constructor of MessageEntityClass.
func ( MessageEntityPre) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityPre.
var (
	_ bin.Encoder     = &MessageEntityPre{}
	_ bin.Decoder     = &MessageEntityPre{}
	_ bin.BareEncoder = &MessageEntityPre{}
	_ bin.BareDecoder = &MessageEntityPre{}

	_ MessageEntityClass = &MessageEntityPre{}
)

func ( *MessageEntityPre) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}
	if !(.Language == "") {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityPre) () string {
	if  == nil {
		return "MessageEntityPre(nil)"
	}
	type  MessageEntityPre
	return fmt.Sprintf("MessageEntityPre%+v", (*))
}

// FillFrom fills MessageEntityPre from given interface.
func ( *MessageEntityPre) ( interface {
	() ( int)
	() ( int)
	() ( string)
}) {
	.Offset = .()
	.Length = .()
	.Language = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityPre) () uint32 {
	return MessageEntityPreTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityPre) () string {
	return "messageEntityPre"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityPre) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityPre",
		ID:   MessageEntityPreTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
		{
			Name:       "Language",
			SchemaName: "language",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityPre) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityPre#73924be0 as nil")
	}
	.PutID(MessageEntityPreTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityPre) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityPre#73924be0 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	.PutString(.Language)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityPre) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityPre#73924be0 to nil")
	}
	if  := .ConsumeID(MessageEntityPreTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityPre#73924be0: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityPre) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityPre#73924be0 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityPre#73924be0: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityPre#73924be0: field length: %w", )
		}
		.Length = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityPre#73924be0: field language: %w", )
		}
		.Language = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityPre) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityPre) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// GetLanguage returns value of Language field.
func ( *MessageEntityPre) () ( string) {
	if  == nil {
		return
	}
	return .Language
}

// MessageEntityTextURL represents TL type `messageEntityTextUrl#76a6d327`.
// Message entity representing a text urlĀ¹: for in-text urls like https://google.comĀ²
// use messageEntityUrlĀ³.
// Note that an additional confirmation popup with the full URL must be displayed to the
// user before opening this link, unless the domain satisfies the conditions specified in
// the domain whitelist documentation Ā»Ā¹.
//
// Links:
//  1. https://google.com
//  2. https://google.com
//  3. https://core.telegram.org/constructor/messageEntityUrl
//  4. https://core.telegram.org/api/config#whitelisted-domains
//
// See https://core.telegram.org/constructor/messageEntityTextUrl for reference.
type MessageEntityTextURL struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
	// The actual URL
	URL string
}

// MessageEntityTextURLTypeID is TL type id of MessageEntityTextURL.
const MessageEntityTextURLTypeID = 0x76a6d327

// construct implements constructor of MessageEntityClass.
func ( MessageEntityTextURL) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityTextURL.
var (
	_ bin.Encoder     = &MessageEntityTextURL{}
	_ bin.Decoder     = &MessageEntityTextURL{}
	_ bin.BareEncoder = &MessageEntityTextURL{}
	_ bin.BareDecoder = &MessageEntityTextURL{}

	_ MessageEntityClass = &MessageEntityTextURL{}
)

func ( *MessageEntityTextURL) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}
	if !(.URL == "") {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityTextURL) () string {
	if  == nil {
		return "MessageEntityTextURL(nil)"
	}
	type  MessageEntityTextURL
	return fmt.Sprintf("MessageEntityTextURL%+v", (*))
}

// FillFrom fills MessageEntityTextURL from given interface.
func ( *MessageEntityTextURL) ( interface {
	() ( int)
	() ( int)
	() ( string)
}) {
	.Offset = .()
	.Length = .()
	.URL = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityTextURL) () uint32 {
	return MessageEntityTextURLTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityTextURL) () string {
	return "messageEntityTextUrl"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityTextURL) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityTextUrl",
		ID:   MessageEntityTextURLTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
		{
			Name:       "URL",
			SchemaName: "url",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityTextURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityTextUrl#76a6d327 as nil")
	}
	.PutID(MessageEntityTextURLTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityTextURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityTextUrl#76a6d327 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	.PutString(.URL)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityTextURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityTextUrl#76a6d327 to nil")
	}
	if  := .ConsumeID(MessageEntityTextURLTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityTextUrl#76a6d327: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityTextURL) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityTextUrl#76a6d327 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityTextUrl#76a6d327: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityTextUrl#76a6d327: field length: %w", )
		}
		.Length = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityTextUrl#76a6d327: field url: %w", )
		}
		.URL = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityTextURL) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityTextURL) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// GetURL returns value of URL field.
func ( *MessageEntityTextURL) () ( string) {
	if  == nil {
		return
	}
	return .URL
}

// MessageEntityMentionName represents TL type `messageEntityMentionName#dc7b1140`.
// Message entity representing a user mentionĀ¹: for creating a mention use
// inputMessageEntityMentionNameĀ².
//
// Links:
//  1. https://core.telegram.org/api/mentions
//  2. https://core.telegram.org/constructor/inputMessageEntityMentionName
//
// See https://core.telegram.org/constructor/messageEntityMentionName for reference.
type MessageEntityMentionName struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
	// Identifier of the user that was mentioned
	UserID int64
}

// MessageEntityMentionNameTypeID is TL type id of MessageEntityMentionName.
const MessageEntityMentionNameTypeID = 0xdc7b1140

// construct implements constructor of MessageEntityClass.
func ( MessageEntityMentionName) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityMentionName.
var (
	_ bin.Encoder     = &MessageEntityMentionName{}
	_ bin.Decoder     = &MessageEntityMentionName{}
	_ bin.BareEncoder = &MessageEntityMentionName{}
	_ bin.BareDecoder = &MessageEntityMentionName{}

	_ MessageEntityClass = &MessageEntityMentionName{}
)

func ( *MessageEntityMentionName) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}
	if !(.UserID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityMentionName) () string {
	if  == nil {
		return "MessageEntityMentionName(nil)"
	}
	type  MessageEntityMentionName
	return fmt.Sprintf("MessageEntityMentionName%+v", (*))
}

// FillFrom fills MessageEntityMentionName from given interface.
func ( *MessageEntityMentionName) ( interface {
	() ( int)
	() ( int)
	() ( int64)
}) {
	.Offset = .()
	.Length = .()
	.UserID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityMentionName) () uint32 {
	return MessageEntityMentionNameTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityMentionName) () string {
	return "messageEntityMentionName"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityMentionName) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityMentionName",
		ID:   MessageEntityMentionNameTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityMentionName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityMentionName#dc7b1140 as nil")
	}
	.PutID(MessageEntityMentionNameTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityMentionName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityMentionName#dc7b1140 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	.PutLong(.UserID)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityMentionName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityMentionName#dc7b1140 to nil")
	}
	if  := .ConsumeID(MessageEntityMentionNameTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityMentionName#dc7b1140: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityMentionName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityMentionName#dc7b1140 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityMentionName#dc7b1140: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityMentionName#dc7b1140: field length: %w", )
		}
		.Length = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityMentionName#dc7b1140: field user_id: %w", )
		}
		.UserID = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityMentionName) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityMentionName) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// GetUserID returns value of UserID field.
func ( *MessageEntityMentionName) () ( int64) {
	if  == nil {
		return
	}
	return .UserID
}

// InputMessageEntityMentionName represents TL type `inputMessageEntityMentionName#208e68c9`.
// Message entity that can be used to create a user user mentionĀ¹: received mentions use
// the messageEntityMentionNameĀ² constructor, instead.
//
// Links:
//  1. https://core.telegram.org/api/mentions
//  2. https://core.telegram.org/constructor/messageEntityMentionName
//
// See https://core.telegram.org/constructor/inputMessageEntityMentionName for reference.
type InputMessageEntityMentionName struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
	// Identifier of the user that was mentioned
	UserID InputUserClass
}

// InputMessageEntityMentionNameTypeID is TL type id of InputMessageEntityMentionName.
const InputMessageEntityMentionNameTypeID = 0x208e68c9

// construct implements constructor of MessageEntityClass.
func ( InputMessageEntityMentionName) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for InputMessageEntityMentionName.
var (
	_ bin.Encoder     = &InputMessageEntityMentionName{}
	_ bin.Decoder     = &InputMessageEntityMentionName{}
	_ bin.BareEncoder = &InputMessageEntityMentionName{}
	_ bin.BareDecoder = &InputMessageEntityMentionName{}

	_ MessageEntityClass = &InputMessageEntityMentionName{}
)

func ( *InputMessageEntityMentionName) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}
	if !(.UserID == nil) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputMessageEntityMentionName) () string {
	if  == nil {
		return "InputMessageEntityMentionName(nil)"
	}
	type  InputMessageEntityMentionName
	return fmt.Sprintf("InputMessageEntityMentionName%+v", (*))
}

// FillFrom fills InputMessageEntityMentionName from given interface.
func ( *InputMessageEntityMentionName) ( interface {
	() ( int)
	() ( int)
	() ( InputUserClass)
}) {
	.Offset = .()
	.Length = .()
	.UserID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputMessageEntityMentionName) () uint32 {
	return InputMessageEntityMentionNameTypeID
}

// TypeName returns name of type in TL schema.
func (*InputMessageEntityMentionName) () string {
	return "inputMessageEntityMentionName"
}

// TypeInfo returns info about TL type.
func ( *InputMessageEntityMentionName) () tdp.Type {
	 := tdp.Type{
		Name: "inputMessageEntityMentionName",
		ID:   InputMessageEntityMentionNameTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
		{
			Name:       "UserID",
			SchemaName: "user_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputMessageEntityMentionName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputMessageEntityMentionName#208e68c9 as nil")
	}
	.PutID(InputMessageEntityMentionNameTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputMessageEntityMentionName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputMessageEntityMentionName#208e68c9 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	if .UserID == nil {
		return fmt.Errorf("unable to encode inputMessageEntityMentionName#208e68c9: field user_id is nil")
	}
	if  := .UserID.Encode();  != nil {
		return fmt.Errorf("unable to encode inputMessageEntityMentionName#208e68c9: field user_id: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *InputMessageEntityMentionName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputMessageEntityMentionName#208e68c9 to nil")
	}
	if  := .ConsumeID(InputMessageEntityMentionNameTypeID);  != nil {
		return fmt.Errorf("unable to decode inputMessageEntityMentionName#208e68c9: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputMessageEntityMentionName) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputMessageEntityMentionName#208e68c9 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputMessageEntityMentionName#208e68c9: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputMessageEntityMentionName#208e68c9: field length: %w", )
		}
		.Length = 
	}
	{
		,  := DecodeInputUser()
		if  != nil {
			return fmt.Errorf("unable to decode inputMessageEntityMentionName#208e68c9: field user_id: %w", )
		}
		.UserID = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *InputMessageEntityMentionName) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *InputMessageEntityMentionName) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// GetUserID returns value of UserID field.
func ( *InputMessageEntityMentionName) () ( InputUserClass) {
	if  == nil {
		return
	}
	return .UserID
}

// MessageEntityPhone represents TL type `messageEntityPhone#9b69e34b`.
// Message entity representing a phone number.
//
// See https://core.telegram.org/constructor/messageEntityPhone for reference.
type MessageEntityPhone struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityPhoneTypeID is TL type id of MessageEntityPhone.
const MessageEntityPhoneTypeID = 0x9b69e34b

// construct implements constructor of MessageEntityClass.
func ( MessageEntityPhone) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityPhone.
var (
	_ bin.Encoder     = &MessageEntityPhone{}
	_ bin.Decoder     = &MessageEntityPhone{}
	_ bin.BareEncoder = &MessageEntityPhone{}
	_ bin.BareDecoder = &MessageEntityPhone{}

	_ MessageEntityClass = &MessageEntityPhone{}
)

func ( *MessageEntityPhone) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityPhone) () string {
	if  == nil {
		return "MessageEntityPhone(nil)"
	}
	type  MessageEntityPhone
	return fmt.Sprintf("MessageEntityPhone%+v", (*))
}

// FillFrom fills MessageEntityPhone from given interface.
func ( *MessageEntityPhone) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityPhone) () uint32 {
	return MessageEntityPhoneTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityPhone) () string {
	return "messageEntityPhone"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityPhone) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityPhone",
		ID:   MessageEntityPhoneTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityPhone#9b69e34b as nil")
	}
	.PutID(MessageEntityPhoneTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityPhone#9b69e34b as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityPhone#9b69e34b to nil")
	}
	if  := .ConsumeID(MessageEntityPhoneTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityPhone#9b69e34b: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityPhone) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityPhone#9b69e34b to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityPhone#9b69e34b: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityPhone#9b69e34b: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityPhone) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityPhone) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityCashtag represents TL type `messageEntityCashtag#4c4e743f`.
// Message entity representing a $cashtag.
//
// See https://core.telegram.org/constructor/messageEntityCashtag for reference.
type MessageEntityCashtag struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityCashtagTypeID is TL type id of MessageEntityCashtag.
const MessageEntityCashtagTypeID = 0x4c4e743f

// construct implements constructor of MessageEntityClass.
func ( MessageEntityCashtag) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityCashtag.
var (
	_ bin.Encoder     = &MessageEntityCashtag{}
	_ bin.Decoder     = &MessageEntityCashtag{}
	_ bin.BareEncoder = &MessageEntityCashtag{}
	_ bin.BareDecoder = &MessageEntityCashtag{}

	_ MessageEntityClass = &MessageEntityCashtag{}
)

func ( *MessageEntityCashtag) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityCashtag) () string {
	if  == nil {
		return "MessageEntityCashtag(nil)"
	}
	type  MessageEntityCashtag
	return fmt.Sprintf("MessageEntityCashtag%+v", (*))
}

// FillFrom fills MessageEntityCashtag from given interface.
func ( *MessageEntityCashtag) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityCashtag) () uint32 {
	return MessageEntityCashtagTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityCashtag) () string {
	return "messageEntityCashtag"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityCashtag) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityCashtag",
		ID:   MessageEntityCashtagTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityCashtag) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityCashtag#4c4e743f as nil")
	}
	.PutID(MessageEntityCashtagTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityCashtag) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityCashtag#4c4e743f as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityCashtag) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityCashtag#4c4e743f to nil")
	}
	if  := .ConsumeID(MessageEntityCashtagTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityCashtag#4c4e743f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityCashtag) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityCashtag#4c4e743f to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityCashtag#4c4e743f: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityCashtag#4c4e743f: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityCashtag) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityCashtag) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityUnderline represents TL type `messageEntityUnderline#9c4e7e8b`.
// Message entity representing underlined text.
//
// See https://core.telegram.org/constructor/messageEntityUnderline for reference.
type MessageEntityUnderline struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityUnderlineTypeID is TL type id of MessageEntityUnderline.
const MessageEntityUnderlineTypeID = 0x9c4e7e8b

// construct implements constructor of MessageEntityClass.
func ( MessageEntityUnderline) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityUnderline.
var (
	_ bin.Encoder     = &MessageEntityUnderline{}
	_ bin.Decoder     = &MessageEntityUnderline{}
	_ bin.BareEncoder = &MessageEntityUnderline{}
	_ bin.BareDecoder = &MessageEntityUnderline{}

	_ MessageEntityClass = &MessageEntityUnderline{}
)

func ( *MessageEntityUnderline) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityUnderline) () string {
	if  == nil {
		return "MessageEntityUnderline(nil)"
	}
	type  MessageEntityUnderline
	return fmt.Sprintf("MessageEntityUnderline%+v", (*))
}

// FillFrom fills MessageEntityUnderline from given interface.
func ( *MessageEntityUnderline) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityUnderline) () uint32 {
	return MessageEntityUnderlineTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityUnderline) () string {
	return "messageEntityUnderline"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityUnderline) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityUnderline",
		ID:   MessageEntityUnderlineTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityUnderline) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityUnderline#9c4e7e8b as nil")
	}
	.PutID(MessageEntityUnderlineTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityUnderline) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityUnderline#9c4e7e8b as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityUnderline) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityUnderline#9c4e7e8b to nil")
	}
	if  := .ConsumeID(MessageEntityUnderlineTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityUnderline#9c4e7e8b: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityUnderline) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityUnderline#9c4e7e8b to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityUnderline#9c4e7e8b: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityUnderline#9c4e7e8b: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityUnderline) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityUnderline) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityStrike represents TL type `messageEntityStrike#bf0693d4`.
// Message entity representing strikethrough text.
//
// See https://core.telegram.org/constructor/messageEntityStrike for reference.
type MessageEntityStrike struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityStrikeTypeID is TL type id of MessageEntityStrike.
const MessageEntityStrikeTypeID = 0xbf0693d4

// construct implements constructor of MessageEntityClass.
func ( MessageEntityStrike) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityStrike.
var (
	_ bin.Encoder     = &MessageEntityStrike{}
	_ bin.Decoder     = &MessageEntityStrike{}
	_ bin.BareEncoder = &MessageEntityStrike{}
	_ bin.BareDecoder = &MessageEntityStrike{}

	_ MessageEntityClass = &MessageEntityStrike{}
)

func ( *MessageEntityStrike) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityStrike) () string {
	if  == nil {
		return "MessageEntityStrike(nil)"
	}
	type  MessageEntityStrike
	return fmt.Sprintf("MessageEntityStrike%+v", (*))
}

// FillFrom fills MessageEntityStrike from given interface.
func ( *MessageEntityStrike) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityStrike) () uint32 {
	return MessageEntityStrikeTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityStrike) () string {
	return "messageEntityStrike"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityStrike) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityStrike",
		ID:   MessageEntityStrikeTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityStrike) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityStrike#bf0693d4 as nil")
	}
	.PutID(MessageEntityStrikeTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityStrike) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityStrike#bf0693d4 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityStrike) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityStrike#bf0693d4 to nil")
	}
	if  := .ConsumeID(MessageEntityStrikeTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityStrike#bf0693d4: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityStrike) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityStrike#bf0693d4 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityStrike#bf0693d4: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityStrike#bf0693d4: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityStrike) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityStrike) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityBankCard represents TL type `messageEntityBankCard#761e6af4`.
// Indicates a credit card number
//
// See https://core.telegram.org/constructor/messageEntityBankCard for reference.
type MessageEntityBankCard struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityBankCardTypeID is TL type id of MessageEntityBankCard.
const MessageEntityBankCardTypeID = 0x761e6af4

// construct implements constructor of MessageEntityClass.
func ( MessageEntityBankCard) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityBankCard.
var (
	_ bin.Encoder     = &MessageEntityBankCard{}
	_ bin.Decoder     = &MessageEntityBankCard{}
	_ bin.BareEncoder = &MessageEntityBankCard{}
	_ bin.BareDecoder = &MessageEntityBankCard{}

	_ MessageEntityClass = &MessageEntityBankCard{}
)

func ( *MessageEntityBankCard) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityBankCard) () string {
	if  == nil {
		return "MessageEntityBankCard(nil)"
	}
	type  MessageEntityBankCard
	return fmt.Sprintf("MessageEntityBankCard%+v", (*))
}

// FillFrom fills MessageEntityBankCard from given interface.
func ( *MessageEntityBankCard) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityBankCard) () uint32 {
	return MessageEntityBankCardTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityBankCard) () string {
	return "messageEntityBankCard"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityBankCard) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityBankCard",
		ID:   MessageEntityBankCardTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityBankCard) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityBankCard#761e6af4 as nil")
	}
	.PutID(MessageEntityBankCardTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityBankCard) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityBankCard#761e6af4 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityBankCard) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityBankCard#761e6af4 to nil")
	}
	if  := .ConsumeID(MessageEntityBankCardTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityBankCard#761e6af4: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityBankCard) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityBankCard#761e6af4 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityBankCard#761e6af4: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityBankCard#761e6af4: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityBankCard) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityBankCard) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntitySpoiler represents TL type `messageEntitySpoiler#32ca960f`.
// Message entity representing a spoiler
//
// See https://core.telegram.org/constructor/messageEntitySpoiler for reference.
type MessageEntitySpoiler struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntitySpoilerTypeID is TL type id of MessageEntitySpoiler.
const MessageEntitySpoilerTypeID = 0x32ca960f

// construct implements constructor of MessageEntityClass.
func ( MessageEntitySpoiler) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntitySpoiler.
var (
	_ bin.Encoder     = &MessageEntitySpoiler{}
	_ bin.Decoder     = &MessageEntitySpoiler{}
	_ bin.BareEncoder = &MessageEntitySpoiler{}
	_ bin.BareDecoder = &MessageEntitySpoiler{}

	_ MessageEntityClass = &MessageEntitySpoiler{}
)

func ( *MessageEntitySpoiler) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntitySpoiler) () string {
	if  == nil {
		return "MessageEntitySpoiler(nil)"
	}
	type  MessageEntitySpoiler
	return fmt.Sprintf("MessageEntitySpoiler%+v", (*))
}

// FillFrom fills MessageEntitySpoiler from given interface.
func ( *MessageEntitySpoiler) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntitySpoiler) () uint32 {
	return MessageEntitySpoilerTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntitySpoiler) () string {
	return "messageEntitySpoiler"
}

// TypeInfo returns info about TL type.
func ( *MessageEntitySpoiler) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntitySpoiler",
		ID:   MessageEntitySpoilerTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntitySpoiler) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntitySpoiler#32ca960f as nil")
	}
	.PutID(MessageEntitySpoilerTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntitySpoiler) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntitySpoiler#32ca960f as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntitySpoiler) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntitySpoiler#32ca960f to nil")
	}
	if  := .ConsumeID(MessageEntitySpoilerTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntitySpoiler#32ca960f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntitySpoiler) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntitySpoiler#32ca960f to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntitySpoiler#32ca960f: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntitySpoiler#32ca960f: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntitySpoiler) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntitySpoiler) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityCustomEmoji represents TL type `messageEntityCustomEmoji#c8cf05f8`.
// Represents a custom emoji.
// Note that this entity must wrap exactly one regular emoji (the one contained in
// documentAttributeCustomEmojiĀ¹.alt) in the related text, otherwise the server will
// ignore it.
//
// Links:
//  1. https://core.telegram.org/constructor/documentAttributeCustomEmoji
//
// See https://core.telegram.org/constructor/messageEntityCustomEmoji for reference.
type MessageEntityCustomEmoji struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
	// Document ID of the custom emojiĀ¹, use messages.getCustomEmojiDocumentsĀ² to fetch the
	// emoji animation and the actual emoji it represents.
	//
	// Links:
	//  1) https://core.telegram.org/api/custom-emoji
	//  2) https://core.telegram.org/method/messages.getCustomEmojiDocuments
	DocumentID int64
}

// MessageEntityCustomEmojiTypeID is TL type id of MessageEntityCustomEmoji.
const MessageEntityCustomEmojiTypeID = 0xc8cf05f8

// construct implements constructor of MessageEntityClass.
func ( MessageEntityCustomEmoji) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityCustomEmoji.
var (
	_ bin.Encoder     = &MessageEntityCustomEmoji{}
	_ bin.Decoder     = &MessageEntityCustomEmoji{}
	_ bin.BareEncoder = &MessageEntityCustomEmoji{}
	_ bin.BareDecoder = &MessageEntityCustomEmoji{}

	_ MessageEntityClass = &MessageEntityCustomEmoji{}
)

func ( *MessageEntityCustomEmoji) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}
	if !(.DocumentID == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityCustomEmoji) () string {
	if  == nil {
		return "MessageEntityCustomEmoji(nil)"
	}
	type  MessageEntityCustomEmoji
	return fmt.Sprintf("MessageEntityCustomEmoji%+v", (*))
}

// FillFrom fills MessageEntityCustomEmoji from given interface.
func ( *MessageEntityCustomEmoji) ( interface {
	() ( int)
	() ( int)
	() ( int64)
}) {
	.Offset = .()
	.Length = .()
	.DocumentID = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityCustomEmoji) () uint32 {
	return MessageEntityCustomEmojiTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityCustomEmoji) () string {
	return "messageEntityCustomEmoji"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityCustomEmoji) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityCustomEmoji",
		ID:   MessageEntityCustomEmojiTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
		{
			Name:       "DocumentID",
			SchemaName: "document_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityCustomEmoji) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityCustomEmoji#c8cf05f8 as nil")
	}
	.PutID(MessageEntityCustomEmojiTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityCustomEmoji) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityCustomEmoji#c8cf05f8 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	.PutLong(.DocumentID)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityCustomEmoji) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityCustomEmoji#c8cf05f8 to nil")
	}
	if  := .ConsumeID(MessageEntityCustomEmojiTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityCustomEmoji#c8cf05f8: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityCustomEmoji) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityCustomEmoji#c8cf05f8 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityCustomEmoji#c8cf05f8: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityCustomEmoji#c8cf05f8: field length: %w", )
		}
		.Length = 
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityCustomEmoji#c8cf05f8: field document_id: %w", )
		}
		.DocumentID = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityCustomEmoji) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityCustomEmoji) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// GetDocumentID returns value of DocumentID field.
func ( *MessageEntityCustomEmoji) () ( int64) {
	if  == nil {
		return
	}
	return .DocumentID
}

// MessageEntityBlockquote represents TL type `messageEntityBlockquote#20df5d0`.
// Message entity representing a block quote.
//
// See https://core.telegram.org/constructor/messageEntityBlockquote for reference.
type MessageEntityBlockquote struct {
	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Offset int
	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	Length int
}

// MessageEntityBlockquoteTypeID is TL type id of MessageEntityBlockquote.
const MessageEntityBlockquoteTypeID = 0x20df5d0

// construct implements constructor of MessageEntityClass.
func ( MessageEntityBlockquote) () MessageEntityClass { return & }

// Ensuring interfaces in compile-time for MessageEntityBlockquote.
var (
	_ bin.Encoder     = &MessageEntityBlockquote{}
	_ bin.Decoder     = &MessageEntityBlockquote{}
	_ bin.BareEncoder = &MessageEntityBlockquote{}
	_ bin.BareDecoder = &MessageEntityBlockquote{}

	_ MessageEntityClass = &MessageEntityBlockquote{}
)

func ( *MessageEntityBlockquote) () bool {
	if  == nil {
		return true
	}
	if !(.Offset == 0) {
		return false
	}
	if !(.Length == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *MessageEntityBlockquote) () string {
	if  == nil {
		return "MessageEntityBlockquote(nil)"
	}
	type  MessageEntityBlockquote
	return fmt.Sprintf("MessageEntityBlockquote%+v", (*))
}

// FillFrom fills MessageEntityBlockquote from given interface.
func ( *MessageEntityBlockquote) ( interface {
	() ( int)
	() ( int)
}) {
	.Offset = .()
	.Length = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessageEntityBlockquote) () uint32 {
	return MessageEntityBlockquoteTypeID
}

// TypeName returns name of type in TL schema.
func (*MessageEntityBlockquote) () string {
	return "messageEntityBlockquote"
}

// TypeInfo returns info about TL type.
func ( *MessageEntityBlockquote) () tdp.Type {
	 := tdp.Type{
		Name: "messageEntityBlockquote",
		ID:   MessageEntityBlockquoteTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Offset",
			SchemaName: "offset",
		},
		{
			Name:       "Length",
			SchemaName: "length",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessageEntityBlockquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityBlockquote#20df5d0 as nil")
	}
	.PutID(MessageEntityBlockquoteTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessageEntityBlockquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messageEntityBlockquote#20df5d0 as nil")
	}
	.PutInt(.Offset)
	.PutInt(.Length)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessageEntityBlockquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityBlockquote#20df5d0 to nil")
	}
	if  := .ConsumeID(MessageEntityBlockquoteTypeID);  != nil {
		return fmt.Errorf("unable to decode messageEntityBlockquote#20df5d0: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessageEntityBlockquote) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messageEntityBlockquote#20df5d0 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityBlockquote#20df5d0: field offset: %w", )
		}
		.Offset = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messageEntityBlockquote#20df5d0: field length: %w", )
		}
		.Length = 
	}
	return nil
}

// GetOffset returns value of Offset field.
func ( *MessageEntityBlockquote) () ( int) {
	if  == nil {
		return
	}
	return .Offset
}

// GetLength returns value of Length field.
func ( *MessageEntityBlockquote) () ( int) {
	if  == nil {
		return
	}
	return .Length
}

// MessageEntityClassName is schema name of MessageEntityClass.
const MessageEntityClassName = "MessageEntity"

// MessageEntityClass represents MessageEntity generic type.
//
// See https://core.telegram.org/type/MessageEntity for reference.
//
// Example:
//
//	g, err := tg.DecodeMessageEntity(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.MessageEntityUnknown: // messageEntityUnknown#bb92ba95
//	case *tg.MessageEntityMention: // messageEntityMention#fa04579d
//	case *tg.MessageEntityHashtag: // messageEntityHashtag#6f635b0d
//	case *tg.MessageEntityBotCommand: // messageEntityBotCommand#6cef8ac7
//	case *tg.MessageEntityURL: // messageEntityUrl#6ed02538
//	case *tg.MessageEntityEmail: // messageEntityEmail#64e475c2
//	case *tg.MessageEntityBold: // messageEntityBold#bd610bc9
//	case *tg.MessageEntityItalic: // messageEntityItalic#826f8b60
//	case *tg.MessageEntityCode: // messageEntityCode#28a20571
//	case *tg.MessageEntityPre: // messageEntityPre#73924be0
//	case *tg.MessageEntityTextURL: // messageEntityTextUrl#76a6d327
//	case *tg.MessageEntityMentionName: // messageEntityMentionName#dc7b1140
//	case *tg.InputMessageEntityMentionName: // inputMessageEntityMentionName#208e68c9
//	case *tg.MessageEntityPhone: // messageEntityPhone#9b69e34b
//	case *tg.MessageEntityCashtag: // messageEntityCashtag#4c4e743f
//	case *tg.MessageEntityUnderline: // messageEntityUnderline#9c4e7e8b
//	case *tg.MessageEntityStrike: // messageEntityStrike#bf0693d4
//	case *tg.MessageEntityBankCard: // messageEntityBankCard#761e6af4
//	case *tg.MessageEntitySpoiler: // messageEntitySpoiler#32ca960f
//	case *tg.MessageEntityCustomEmoji: // messageEntityCustomEmoji#c8cf05f8
//	case *tg.MessageEntityBlockquote: // messageEntityBlockquote#20df5d0
//	default: panic(v)
//	}
type MessageEntityClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() MessageEntityClass

	// 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

	// Offset of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	GetOffset() (value int)

	// Length of message entity within message (in UTF-16 code unitsĀ¹)
	//
	// Links:
	//  1) https://core.telegram.org/api/entities#entity-length
	GetLength() (value int)
}

// DecodeMessageEntity implements binary de-serialization for MessageEntityClass.
func ( *bin.Buffer) (MessageEntityClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case MessageEntityUnknownTypeID:
		// Decoding messageEntityUnknown#bb92ba95.
		 := MessageEntityUnknown{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityMentionTypeID:
		// Decoding messageEntityMention#fa04579d.
		 := MessageEntityMention{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityHashtagTypeID:
		// Decoding messageEntityHashtag#6f635b0d.
		 := MessageEntityHashtag{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityBotCommandTypeID:
		// Decoding messageEntityBotCommand#6cef8ac7.
		 := MessageEntityBotCommand{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityURLTypeID:
		// Decoding messageEntityUrl#6ed02538.
		 := MessageEntityURL{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityEmailTypeID:
		// Decoding messageEntityEmail#64e475c2.
		 := MessageEntityEmail{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityBoldTypeID:
		// Decoding messageEntityBold#bd610bc9.
		 := MessageEntityBold{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityItalicTypeID:
		// Decoding messageEntityItalic#826f8b60.
		 := MessageEntityItalic{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityCodeTypeID:
		// Decoding messageEntityCode#28a20571.
		 := MessageEntityCode{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityPreTypeID:
		// Decoding messageEntityPre#73924be0.
		 := MessageEntityPre{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityTextURLTypeID:
		// Decoding messageEntityTextUrl#76a6d327.
		 := MessageEntityTextURL{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityMentionNameTypeID:
		// Decoding messageEntityMentionName#dc7b1140.
		 := MessageEntityMentionName{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case InputMessageEntityMentionNameTypeID:
		// Decoding inputMessageEntityMentionName#208e68c9.
		 := InputMessageEntityMentionName{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityPhoneTypeID:
		// Decoding messageEntityPhone#9b69e34b.
		 := MessageEntityPhone{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityCashtagTypeID:
		// Decoding messageEntityCashtag#4c4e743f.
		 := MessageEntityCashtag{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityUnderlineTypeID:
		// Decoding messageEntityUnderline#9c4e7e8b.
		 := MessageEntityUnderline{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityStrikeTypeID:
		// Decoding messageEntityStrike#bf0693d4.
		 := MessageEntityStrike{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityBankCardTypeID:
		// Decoding messageEntityBankCard#761e6af4.
		 := MessageEntityBankCard{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntitySpoilerTypeID:
		// Decoding messageEntitySpoiler#32ca960f.
		 := MessageEntitySpoiler{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityCustomEmojiTypeID:
		// Decoding messageEntityCustomEmoji#c8cf05f8.
		 := MessageEntityCustomEmoji{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	case MessageEntityBlockquoteTypeID:
		// Decoding messageEntityBlockquote#20df5d0.
		 := MessageEntityBlockquote{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode MessageEntityClass: %w", bin.NewUnexpectedID())
	}
}

// MessageEntity boxes the MessageEntityClass providing a helper.
type MessageEntityBox struct {
	MessageEntity MessageEntityClass
}

// Decode implements bin.Decoder for MessageEntityBox.
func ( *MessageEntityBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode MessageEntityBox to nil")
	}
	,  := DecodeMessageEntity()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.MessageEntity = 
	return nil
}

// Encode implements bin.Encode for MessageEntityBox.
func ( *MessageEntityBox) ( *bin.Buffer) error {
	if  == nil || .MessageEntity == nil {
		return fmt.Errorf("unable to encode MessageEntityClass as nil")
	}
	return .MessageEntity.Encode()
}