Skip to content

Commit

Permalink
Fix typo in telegram/auth.go and remove unused code in telegram/inlin…
Browse files Browse the repository at this point in the history
…equery.go

~ go-misspell
~ go-ineffassign
  • Loading branch information
AmarnathCJD committed Apr 26, 2024
1 parent 9dcf3fd commit 917e93d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion telegram/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func (c *Client) ScrapeAppConfig(config ...*ScrapeConfig) (int32, string, bool,

if conf.WebCodeCallback == nil {
conf.WebCodeCallback = func() (string, error) {
fmt.Printf("Enter recieved web login code: ")
fmt.Printf("Enter received web login code: ")
var password string
fmt.Scanln(&password)
return password, nil
Expand Down
12 changes: 3 additions & 9 deletions telegram/inlinequery.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ PhotoTypeSwitch:
case *InputMediaPhoto:
image = p.ID
case *InputMediaUploadedPhoto:
media, err := b.Client.MessagesUploadMedia(opts.BuissnessConnectionId, &InputPeerSelf{}, p)
if err != nil {
image = &InputPhotoEmpty{}
}
media, _ := b.Client.MessagesUploadMedia(opts.BuissnessConnectionId, &InputPeerSelf{}, p)

inputPhoto, err = b.Client.getSendableMedia(media, &MediaMetadata{})
if err != nil {
Expand Down Expand Up @@ -187,15 +184,12 @@ DocTypeSwitch:
case *InputMediaDocument:
document = p.ID
case *InputMediaUploadedDocument:
media, err := b.Client.MessagesUploadMedia(opts.BuissnessConnectionId, &InputPeerSelf{}, p)
if err != nil {
document = &InputDocumentEmpty{}
}
media, _ := b.Client.MessagesUploadMedia(opts.BuissnessConnectionId, &InputPeerSelf{}, p)

inputDoc, _ = b.Client.getSendableMedia(media, &MediaMetadata{})
goto DocTypeSwitch
default:
b.Client.Logger.Error("InlineBuilder.Document: Document is not a InputMediaDocument")
doc = &InputDocumentEmpty{}
}

e, text := b.Client.FormatMessage(opts.Caption, getValue(opts.ParseMode, b.Client.ParseMode()).(string))
Expand Down

0 comments on commit 917e93d

Please sign in to comment.