feat: initial implementation of uptodownbot
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.
This commit is contained in:
27
internal/repo/interface.go
Normal file
27
internal/repo/interface.go
Normal file
@@ -0,0 +1,27 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user