Skip to content

[bot.CreateNewStickerSet] bad request, Bad Request: wrong HTTP URL specified #164

Open
@ruizlenato

Description

@ruizlenato

Console:

false
bad request, Bad Request: wrong HTTP URL specified

Code:

...
  response, err := http.Get(b.FileDownloadLink(file))
  if err != nil {
    sendGetStickerError(ctx, b, update, i18n, "Couldn't download file", err)
    return
  }
  defer response.Body.Close()

  bodyBytes, err := io.ReadAll(response.Body)
  if err != nil {
    sendGetStickerError(ctx, b, update, i18n, "Couldn't read body", err)
    return
  }

...
		a, err := b.CreateNewStickerSet(ctx, &bot.CreateNewStickerSetParams{
			UserID: update.Message.From.ID,
			Name:   stickerSetShortName,
			Title:  stickerSetTitle,
			Stickers: []models.InputSticker{
				{
					Sticker: &models.InputFileUpload{
						Filename: filepath.Base(b.FileDownloadLink(file)),
						Data:     bytes.NewBuffer(bodyBytes),
					},
					Format:    stickerType,
					EmojiList: emoji,
				},
			},
		})
		fmt.Println(err)
		fmt.Println(a)
...

Debug:

request url: https://api.telegram.org/botBOTTOKEN/createNewStickerSet, payload: {"user_id":1032274246,"name":"a_1032274246_by_SmudgeBetaBot","title":"@ruizlenato's SmudgeLord","stickers":[{"sticker":"@file_2.webp","format":"static","emoji_list":["🐵"]}]}
bad request, Bad Request: wrong HTTP URL specified

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions