api

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BotAuthorize

func BotAuthorize(apiIdRaw, apiHash string, botToken string) (tClient *client.Client, err error)

Authorize logs the bot into the provided account using tdlib.

func CheckBotUsernameByUserID

func CheckBotUsernameByUserID(userID int64) (string, bool, error)

func ClientAuthorize

func ClientAuthorize(apiIdRaw, apiHash string) (tClient *client.Client, err error)

func GetChat

func GetChat(chatID int64) (*client.Chat, error)

GetChat retrieves a chat by its chatID. It may be required before the bot is able to send messages to a certain chat, if it hasn't received updates from it.

func GetChatTitle added in v0.1.3

func GetChatTitle(chatID int64) (string, error)

func GetMessage

func GetMessage(chatID, messageID int64) (*client.Message, error)

GetMessage returns the client.Message with the input messageID in the input chatID.

func GetMessageFormattedText

func GetMessageFormattedText(mc client.MessageContent) *client.FormattedText

GetMessageFormattedText returns the client.FormattedText structure for supported message types, nil otherwise.

func GetMessageLink(chatID, messageID int64, mediaTimestamp int32, forAlbum bool, inMessageThread bool) (*client.MessageLink, error)

获取消息链接

func GetSenderChatID

func GetSenderChatID(message *client.Message) (int64, error)

func GetSenderID

func GetSenderID(message *client.Message) (int64, error)

func GetSenderUserID

func GetSenderUserID(message *client.Message) (int64, error)

GetSenderUserID returns the sender user id, if the message was not sent on behalf of a chat

func GetSupergroupByID added in v0.1.3

func GetSupergroupByID(id int64) (*client.Supergroup, error)

func GetSupergroupUsernamesByID added in v0.1.3

func GetSupergroupUsernamesByID(id int64) ([]string, error)

func GetUserByID

func GetUserByID(userID int64) (*client.User, error)

GetUserByID returns a client.User given a userID.

func GetUserFirstLastName added in v0.1.3

func GetUserFirstLastName(userID int64) (string, string, error)

func GetUsernameByID added in v0.0.3

func GetUsernameByID(userID int64) (string, error)

func GetUsernamesByID

func GetUsernamesByID(userID int64) ([]string, error)

func IsViaBotByUserID

func IsViaBotByUserID(userID int64, viaBotUserId int64) (bool, error)

func ReportMessage

func ReportMessage(chatID, messageID int64, reason client.ReportReason, text string) (*client.Ok, error)

func SendMessageText added in v0.1.3

func SendMessageText(text string, chatID int64) (*client.Message, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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