functions

package
v1.0.0-my-beta16 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddChatMembers

func AddChatMembers(context context.Context, client *tg.Client, chatPeer tg.InputPeerClass, users []tg.InputUserClass, forwardLimit int) (bool, error)

func ArchiveChats

func ArchiveChats(context context.Context, client *tg.Client, peers []tg.InputPeerClass) (bool, error)

func BanChatMember

func BanChatMember(context context.Context, client *tg.Client, chatPeer tg.InputPeerClass, userPeer *tg.InputPeerUser, untilDate int) (tg.UpdatesClass, error)

func CreateChannel

func CreateChannel(context context.Context, client *tg.Client, title, about string, broadcast bool) (*tg.Channel, error)

func CreateChat

func CreateChat(context context.Context, client *tg.Client, title string, users []tg.InputUserClass) (*tg.Chat, error)

func DecodeStringToSession

func DecodeStringToSession(sessionString string) (*storage.Session, error)

DecodeStringToSession decodes the provided base64 encoded session string to session.Data.

func DemoteChatMember

func DemoteChatMember(ctx context.Context, client *tg.Client, chat, user *storage.Peer, rights tg.ChatAdminRights, title string) (bool, error)

func EncodeSessionToString

func EncodeSessionToString(session *storage.Session) (string, error)

EncodeSessionToString encodes the provided session to a string in base64 using json bytes.

func GetChannelMessages

func GetChannelMessages(context context.Context, client *tg.Client, peer tg.InputChannelClass, messageIds []tg.InputMessageClass) (tg.MessageClassArray, error)

func GetChatFromPeer

func GetChatFromPeer(ctx context.Context, client *tg.Client, peer tg.PeerClass) (*tg.ChatFull, error)

GetChatFromPeer returns the tg.ChatFull data of the provided tg.PeerClass.

func GetChatIdFromPeer

func GetChatIdFromPeer(peer tg.PeerClass) int64

GetChatIdFromPeer returns the chat/user id from the provided tg.PeerClass.

func GetChatMessages

func GetChatMessages(context context.Context, client *tg.Client, messageIds []tg.InputMessageClass) (tg.MessageClassArray, error)

func GetEditMessageUpdate

func GetEditMessageUpdate(upds tg.UpdatesClass) *tg.Message

func GetInputPeerClassFromId

func GetInputPeerClassFromId(iD int64) tg.InputPeerClass

GetInputPeerClassFromId finds provided user id in the session storage and returns it if found.

func GetMessageFromMessageClass

func GetMessageFromMessageClass(m tg.MessageClass) *tg.Message

func GetMessages

func GetMessages(ctx context.Context, raw *tg.Client, chatId int64, mids []tg.InputMessageClass) (tg.MessageClassArray, error)

func GetNewMessageUpdate

func GetNewMessageUpdate(msgData *tg.Message, upds tg.UpdatesClass) *tg.Message

func GetUpdateClassFromUpdatesClass

func GetUpdateClassFromUpdatesClass(updates tg.UpdatesClass) (u []tg.UpdateClass)

func PromoteChatMember

func PromoteChatMember(ctx context.Context, client *tg.Client, chat, user *storage.Peer, rights tg.ChatAdminRights, title string) (bool, error)

func ReturnEditMessageWithError

func ReturnEditMessageWithError(upds tg.UpdatesClass, err error) (*tg.Message, error)

func ReturnNewMessageWithError

func ReturnNewMessageWithError(msgData *tg.Message, upds tg.UpdatesClass, err error) (*tg.Message, error)

func SavePeersFromClassArray

func SavePeersFromClassArray(cs []tg.ChatClass, us []tg.UserClass)

func UnarchiveChats

func UnarchiveChats(context context.Context, client *tg.Client, peers []tg.InputPeerClass) (bool, error)

func UnbanChatMember

func UnbanChatMember(context context.Context, client *tg.Client, chatPeer *tg.InputPeerChannel, userPeer *tg.InputPeerUser) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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