Documentation ¶
Index ¶
- func GetChatID(peer tg.PeerClass) int64
- func GetMessageIDFromMessage(message tg.MessageClass) networkid.MessageID
- func InternalMakePortalKey(peer tg.PeerClass, receiver networkid.UserLoginID) networkid.PortalKey
- func MakeAvatarID(photoID int64) networkid.AvatarID
- func MakeChannelUserID(channelID int64) networkid.UserID
- func MakeEmojiIDFromDocumentID(documentID int64) networkid.EmojiID
- func MakeEmojiIDFromEmoticon(emoji string) networkid.EmojiID
- func MakeMessageID(rawChatID any, messageID int) networkid.MessageID
- func MakePaginationCursorID(messageID int) networkid.PaginationCursor
- func MakeUserID(userID int64) networkid.UserID
- func MakeUserLoginID(userID int64) networkid.UserLoginID
- func ParseEmojiID(emojiID networkid.EmojiID) (documentID int64, emoji string, err error)
- func ParseMessageID(networkID networkid.MessageID) (channelID int64, messageID int, err error)
- func ParseUserLoginID(userID networkid.UserLoginID) (int64, error)
- type DirectMediaInfo
- type PeerType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessageIDFromMessage ¶
func GetMessageIDFromMessage(message tg.MessageClass) networkid.MessageID
func InternalMakePortalKey ¶
func MakeAvatarID ¶
func MakeChannelUserID ¶
func MakeEmojiIDFromEmoticon ¶
func MakePaginationCursorID ¶
func MakePaginationCursorID(messageID int) networkid.PaginationCursor
func MakeUserID ¶
func MakeUserLoginID ¶
func MakeUserLoginID(userID int64) networkid.UserLoginID
func ParseEmojiID ¶
func ParseMessageID ¶
func ParseUserLoginID ¶
func ParseUserLoginID(userID networkid.UserLoginID) (int64, error)
Types ¶
type DirectMediaInfo ¶
type DirectMediaInfo struct { PeerType PeerType ChatID int64 ReceiverID int64 MessageID int64 TelegramMediaID int64 Thumbnail bool }
DirectMediaInfo is the information that is encoded in the media ID when using direct media.
The format of the media ID is as follows (each character represents a single byte, |'s added for clarity):
v|p|cccccccc|rrrrrrrr|mmmmmmmm|T|MMMMMMMM
v (int8) = binary encoding format version. Should be 0. p (byte) = the peer type of the Telegram chat ID cccccccc (int64) = the Telegram chat ID (big endian) rrrrrrrr (int64) = the receiver ID (big endian) mmmmmmmm (int64) = the Telegram message ID (big endian) MMMMMMMM (int64) = the Telegram media ID (big endian) T (byte) = 0 or 1 depending on whether it's a thumbnail
func ParseDirectMediaInfo ¶
func ParseDirectMediaInfo(mediaID networkid.MediaID) (info DirectMediaInfo, err error)
type PeerType ¶
type PeerType string
func ParsePortalID ¶
func PeerTypeFromByte ¶
func (PeerType) InternalAsPortalKey ¶
Click to show internal directories.
Click to hide internal directories.