Skip to content

Commit

Permalink
mb
Browse files Browse the repository at this point in the history
  • Loading branch information
AmarnathCJD committed Nov 22, 2024
1 parent c7b4527 commit a2a2074
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion telegram/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var (
"upload_document": &SendMessageUploadDocumentAction{},
"game": &SendMessageGamePlayAction{},
"cancel": &SendMessageCancelAction{},
"round_video": &SendMessageUploadRoundAction{},
"upload_round": &SendMessageUploadRoundAction{},
"call": &SpeakingInGroupCallAction{},
"record_round": &SendMessageRecordRoundAction{},
"history_import": &SendMessageHistoryImportAction{},
Expand Down
7 changes: 3 additions & 4 deletions telegram/media.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (wp *WorkerPool) FreeWorker(s *Sender) {
}

type Source struct {
Source interface{}
Source any
}

func (s *Source) GetSizeAndName() (int64, string) {
Expand Down Expand Up @@ -119,7 +119,7 @@ func (s *Source) GetReader() io.Reader {
return nil
}

func (c *Client) UploadFile(src interface{}, Opts ...*UploadOptions) (InputFile, error) {
func (c *Client) UploadFile(src any, Opts ...*UploadOptions) (InputFile, error) {
opts := getVariadic(Opts, &UploadOptions{})
if src == nil {
return nil, errors.New("file can not be nil")
Expand Down Expand Up @@ -413,7 +413,7 @@ func (mb *Destination) Close() error {
return nil
}

func (c *Client) DownloadMedia(file interface{}, Opts ...*DownloadOptions) (string, error) {
func (c *Client) DownloadMedia(file any, Opts ...*DownloadOptions) (string, error) {
opts := getVariadic(Opts, &DownloadOptions{})
location, dc, size, fileName, err := GetFileLocation(file)
if err != nil {
Expand Down Expand Up @@ -485,7 +485,6 @@ func (c *Client) DownloadMedia(file interface{}, Opts ...*DownloadOptions) (stri
case <-progressTicker:
return
case <-ticker.C:
fmt.Println(opts.ProgressManager.GetStats(doneBytes.Load()))
opts.ProgressManager.editFunc(size, doneBytes.Load())
}
}
Expand Down

0 comments on commit a2a2074

Please sign in to comment.