tg_client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CtxTelegramClientInstance

func CtxTelegramClientInstance(entry interface{}, ctx context.Context) context.Context

func GenerateStringFromTemplate

func GenerateStringFromTemplate(info map[string]interface{}, myTemplate string) (string, error)

func NewTgAsInterface

func NewTgAsInterface(cfg config.Config, ctx context.Context) interface{}

Types

type Chat

type Chat struct {
	Title         string
	Id            int64
	AccessHash    *int64
	Photo         *tg.ChatPhotoClass
	MembersAmount int64
}

type TelegramClient

type TelegramClient interface {
	GetUserFromApi(client *telegram.Client, username, phone *string) (*data.User, error)
	GetChatUsersFromApi(chat Chat) ([]data.User, error)
	GetChatUserFromApi(user data.User, chat Chat) (*data.User, error)
	SearchByFromApi(username, phone *string, amount int) ([]data.User, error)

	GetChatFromApi(title string) ([]Chat, error)
	AddUserInChatFromApi(user data.User, chat Chat) error
	UpdateUserInChatFromApi(user data.User, chat Chat) error
	DeleteFromChatFromApi(user data.User, chat Chat) error

	SendMessageFromApi(info data.MessageInfo) error
	GenerateChatLinkFromApi(chat Chat) (string, error)
	GetChatPhotoFromApi(filename *string, chat Chat) (string, error)

	GetTg() *tgInfo
	GetSuperClient() *telegram.Client
	GetUsualClient() *telegram.Client
}

func TelegramClientInstance

func TelegramClientInstance(ctx context.Context) TelegramClient

Jump to

Keyboard shortcuts

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