services

package
v0.0.0-...-da9f86b Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *sql.DB

Functions

func AddMembersFromJson

func AddMembersFromJson(jsonFile, targetGroup, apiToken string) error

AddMembersFromJson calls a Python script to add members to a Telegram group from a JSON file.

func CloseDatabase

func CloseDatabase()

CloseDatabase closes the database connection

func CreateUploadsDirectory

func CreateUploadsDirectory()

CreateUploadsDirectory creates the uploads directory if it doesn't exist

func GetSettings

func GetSettings() (map[string]string, error)

GetSettings retrieves settings from the database

func GetUserDetails

func GetUserDetails(phoneNumbers []string, outputJsonFile string) error

GetUserDetails calls a Python script to get user details from phone numbers.

func InitializeDatabase

func InitializeDatabase() error

InitializeDatabase initializes the database connection

func UpdateSettings

func UpdateSettings(settings Settings) error

UpdateSettings updates settings in the database

Types

type Settings

type Settings struct {
	BatchSize             int            `json:"batch_size"`
	TargetGroup           string         `json:"target_group"`
	ApiToken              string         `json:"api_token"`
	ApiId                 int            `json:"api_id"`
	ApiHash               string         `json:"api_hash"`
	AuthorizedPhoneNumber string         `json:"authorized_phone_number"`
	PhonePrefix           string         `json:"phone_prefix"`
	AuthorizationState    sql.NullString `json:"authorization_state"`
}

Settings represents the application settings

Jump to

Keyboard shortcuts

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