types

package
v1.0.0-my-beta35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel tg.Channel

Channel implements EffectiveChat interface for tg.Channel chats.

func (*Channel) GetAccessHash

func (v *Channel) GetAccessHash() int64

GetAccessHash Use this method to get access hash of the effective chat.

func (*Channel) GetID

func (v *Channel) GetID() int64

GetID Use this method to get chat id.

func (*Channel) GetInputChannel

func (v *Channel) GetInputChannel() tg.InputChannelClass

GetInputChannel Use this method to get InputChannelClass

func (*Channel) GetInputPeer

func (v *Channel) GetInputPeer() tg.InputPeerClass

GetInputPeer Use this method to get InputPeerClass

func (*Channel) GetInputUser

func (*Channel) GetInputUser() tg.InputUserClass

GetInputUser Use this method to get InputUserClass Always nil for Channel

func (*Channel) IsAChannel

func (*Channel) IsAChannel() bool

IsAChannel returns true for a channel.

func (*Channel) IsAChat

func (*Channel) IsAChat() bool

IsAChat returns true for a chat.

func (*Channel) IsAUser

func (*Channel) IsAUser() bool

IsAUser returns true for a user.

func (*Channel) Raw

func (v *Channel) Raw() *tg.Channel

type Chat

type Chat tg.Chat

Chat implements EffectiveChat interface for tg.Chat chats.

func (*Chat) GetAccessHash

func (*Chat) GetAccessHash() int64

GetAccessHash Use this method to get access hash of the effective chat.

func (*Chat) GetID

func (c *Chat) GetID() int64

GetID Use this method to get chat id.

func (*Chat) GetInputChannel

func (*Chat) GetInputChannel() tg.InputChannelClass

GetInputChannel Use this method to get InputChannelClass Always nil for Chat

func (*Chat) GetInputPeer

func (c *Chat) GetInputPeer() tg.InputPeerClass

GetInputPeer Use this method to get InputPeerClass

func (*Chat) GetInputUser

func (*Chat) GetInputUser() tg.InputUserClass

GetInputUser Use this method to get InputUserClass Always nil for Chat

func (*Chat) IsAChannel

func (*Chat) IsAChannel() bool

IsAChannel returns true for a channel.

func (*Chat) IsAChat

func (*Chat) IsAChat() bool

IsAChat returns true for a chat.

func (*Chat) IsAUser

func (*Chat) IsAUser() bool

IsAUser returns true for a user.

func (*Chat) Raw

func (c *Chat) Raw() *tg.Chat

type EffectiveChat

type EffectiveChat interface {
	// GetID Use this method to get chat id.
	GetID() int64
	// GetAccessHash Use this method to get access hash of the effective chat.
	GetAccessHash() int64
	// IsAChannel Use this method to check if the effective chat is a channel.
	IsAChannel() bool
	// IsAChat Use this method to check if the effective chat is a chat.
	IsAChat() bool
	// IsAUser Use this method to check if the effective chat is a user.
	IsAUser() bool
	// GetInputUser Use this method to get InputUserClass
	GetInputUser() tg.InputUserClass
	// GetInputChannel Use this method to get InputUserClass
	GetInputChannel() tg.InputChannelClass
	// GetInputPeer Use this method to get InputUserClass
	GetInputPeer() tg.InputPeerClass
}

EffectiveChat interface covers the all three types of chats: - tg.User - tg.Chat - tg.Channel

This interface is implemented by the following structs: - User: If the chat is a tg.User then this struct will be returned. - Chat: if the chat is a tg.Chat then this struct will be returned. - Channel: if the chat is a tg.Channel then this struct will be returned. - EmptyUC: if the PeerID doesn't match any of the above cases then EmptyUC struct is returned.

type EmptyUC

type EmptyUC struct{}

EmptyUC implements EffectiveChat interface for empty chats.

func (*EmptyUC) GetAccessHash

func (*EmptyUC) GetAccessHash() int64

GetAccessHash Use this method to get access hash of effective chat. Always 0 for EmptyUC

func (*EmptyUC) GetID

func (*EmptyUC) GetID() int64

GetID Use this method to get chat id. Always 0 for EmptyUC

func (*EmptyUC) GetInputChannel

func (*EmptyUC) GetInputChannel() tg.InputChannelClass

GetInputChannel Use this method to get InputChannelClass Always nil for EmptyUC

func (*EmptyUC) GetInputPeer

func (*EmptyUC) GetInputPeer() tg.InputPeerClass

GetInputPeer Use this method to get InputPeerClass Always nil for EmptyUC

func (*EmptyUC) GetInputUser

func (*EmptyUC) GetInputUser() tg.InputUserClass

GetInputUser Use this method to get InputUserClass Always nil for EmptyUC

func (*EmptyUC) IsAChannel

func (*EmptyUC) IsAChannel() bool

IsAChannel returns true for a channel. Always false for EmptyUC

func (*EmptyUC) IsAChat

func (*EmptyUC) IsAChat() bool

IsAChat returns true for a chat. Always false for EmptyUC

func (*EmptyUC) IsAUser

func (*EmptyUC) IsAUser() bool

IsAUser returns true for a user. Always false for EmptyUC

type Message

type Message struct {
	*tg.Message
	ReplyToMessage *Message
	Text           string
	IsService      bool
	Action         tg.MessageActionClass
}

func ConstructMessage

func ConstructMessage(m tg.MessageClass) *Message

func (*Message) SetRepliedToMessage

func (m *Message) SetRepliedToMessage(ctx context.Context, raw *tg.Client, p *storage.PeerStorage) error

type User

type User tg.User

User implements EffectiveChat interface for tg.User chats.

func (*User) GetAccessHash

func (u *User) GetAccessHash() int64

GetAccessHash Use this method to get access hash of the effective chat.

func (*User) GetID

func (u *User) GetID() int64

GetID Use this method to get chat id.

func (*User) GetInputChannel

func (*User) GetInputChannel() tg.InputChannelClass

GetInputChannel Use this method to get InputChannelClass Always nil for User

func (*User) GetInputPeer

func (u *User) GetInputPeer() tg.InputPeerClass

GetInputPeer Use this method to get InputPeerClass

func (*User) GetInputUser

func (u *User) GetInputUser() tg.InputUserClass

GetInputUser Use this method to get InputUserClass

func (*User) IsAChannel

func (*User) IsAChannel() bool

IsAChannel returns true for a channel.

func (*User) IsAChat

func (*User) IsAChat() bool

IsAChat returns true for a chat.

func (*User) IsAUser

func (*User) IsAUser() bool

IsAUser returns true for a user.

func (*User) Raw

func (u *User) Raw() *tg.User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL