Telegram bot for downloading media from any site using yt-dlp. Supports audio/video/both, quality selection, language picker, container format selection, playlist pagination, progress updates, per-user quotas, user preferences, download history, cancel at any step, polling and webhook modes, proxy support, and SQLite persistence.
28 lines
711 B
Go
28 lines
711 B
Go
package repo
|
|
|
|
import "uptodownBot/internal/domain"
|
|
|
|
type Repository interface {
|
|
// Users
|
|
GetOrCreateUser(chatID int64) (int64, error)
|
|
|
|
// Preferences
|
|
GetOrCreatePreferences(userID int64) (*domain.UserPreferences, error)
|
|
UpdatePreferences(userID int64, prefs *domain.UserPreferences) error
|
|
|
|
// Quotas
|
|
GetOrCreateQuotas(userID int64) (*domain.UserQuotas, error)
|
|
UpdateQuotas(userID int64, q *domain.UserQuotas) error
|
|
|
|
// Download history
|
|
AddHistory(userID int64, record *domain.DownloadRecord) error
|
|
GetHistory(userID int64, limit, offset int) ([]domain.DownloadRecord, error)
|
|
GetHistoryCount(userID int64) (int, error)
|
|
|
|
// Account
|
|
DeleteUserData(userID int64) error
|
|
|
|
// Lifecycle
|
|
Close() error
|
|
}
|