Skip to content

Can't edit thumbnail as InputFile on editMessageMedia #1984

Description

@matteolungo

Context

  • Telegraf.js Version: 4.16.3
  • Node.js Version: 18.15.0
  • Operating System: Windows 11

Minimal Example Code Reproducing the Issue

reply = await ctx.editMessageMedia({
    type: 'audio', media: {
        source: fs.readFileSync(`${title}.mp3`),
        thumbnail: { source: fs.readFileSync('thumbnail.jpg') }
    }
})

Expected Behavior

The thumbnail is being edited

Current Behavior

The API returns the error below (I use the same syntax to attach thumbnail in sendAudio method and it's working correctly).

Error Message and Logs

Error: 400: Bad Request: can't parse InputMedia: Field "thumbnail" must be of type String

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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