From a2a207486d7e6c3cccce2812a717890597179da9 Mon Sep 17 00:00:00 2001 From: AmarnathCJD Date: Fri, 22 Nov 2024 21:56:15 +0530 Subject: [PATCH] mb --- telegram/const.go | 2 +- telegram/media.go | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/telegram/const.go b/telegram/const.go index 9ca5ccbd..9e0731c1 100644 --- a/telegram/const.go +++ b/telegram/const.go @@ -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{}, diff --git a/telegram/media.go b/telegram/media.go index fd084432..409a1cbe 100644 --- a/telegram/media.go +++ b/telegram/media.go @@ -62,7 +62,7 @@ func (wp *WorkerPool) FreeWorker(s *Sender) { } type Source struct { - Source interface{} + Source any } func (s *Source) GetSizeAndName() (int64, string) { @@ -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") @@ -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 { @@ -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()) } }