types

package
v1.0.0-my-beta22 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: GPL-3.0 Imports: 4 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 (u *Channel) GetAccessHash() int64

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

func (*Channel) GetID

func (u *Channel) GetID() int64

Use this method to get chat id.

func (*Channel) GetInputChannel

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

Use this method to get InputChannelClass

func (*Channel) GetInputPeer

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

Use this method to get InputPeerClass

func (*Channel) GetInputUser

func (*Channel) GetInputUser() tg.InputUserClass

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 (u *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

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

func (*Chat) GetID

func (u *Chat) GetID() int64

Use this method to get chat id.

func (*Chat) GetInputChannel

func (*Chat) GetInputChannel() tg.InputChannelClass

Use this method to get InputChannelClass Always nil for Chat

func (*Chat) GetInputPeer

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

Use this method to get InputPeerClass

func (*Chat) GetInputUser

func (*Chat) GetInputUser() tg.InputUserClass

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 (u *Chat) Raw() *tg.Chat

type EffectiveChat

type EffectiveChat interface {
	// Use this method to get chat id.
	GetID() int64
	// Use this method to get access hash of the effective chat.
	GetAccessHash() int64
	// Use this method to check if the effective chat is a channel.
	IsAChannel() bool
	// Use this method to check if the effective chat is a chat.
	IsAChat() bool
	// Use this method to check if the effective chat is a user.
	IsAUser() bool
	// Use this method to get InputUserClass
	GetInputUser() tg.InputUserClass
	// Use this method to get InputUserClass
	GetInputChannel() tg.InputChannelClass
	// 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

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

func (*EmptyUC) GetID

func (*EmptyUC) GetID() int64

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

func (*EmptyUC) GetInputChannel

func (*EmptyUC) GetInputChannel() tg.InputChannelClass

Use this method to get InputChannelClass Always nil for EmptyUC

func (*EmptyUC) GetInputPeer

func (*EmptyUC) GetInputPeer() tg.InputPeerClass

Use this method to get InputPeerClass Always nil for EmptyUC

func (*EmptyUC) GetInputUser

func (*EmptyUC) GetInputUser() tg.InputUserClass

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) error

type User

type User tg.User

User implements EffectiveChat interface for tg.User chats.

func (*User) GetAccessHash

func (u *User) GetAccessHash() int64

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

func (*User) GetID

func (u *User) GetID() int64

Use this method to get chat id.

func (*User) GetInputChannel

func (*User) GetInputChannel() tg.InputChannelClass

Use this method to get InputChannelClass Always nil for User

func (*User) GetInputPeer

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

Use this method to get InputPeerClass

func (*User) GetInputUser

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

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