Skip to content

getFile give an error in webhook mode #65

@alireza-pishbin

Description

@alireza-pishbin

Hello
I set webhook and let telegram send me an update by http post method.
I want to get document which is sent by user as below with API controller:

[HttpPost]
public async Task<IHttpActionResult> post(Update update)
{
NetTelegramBotApi.Types.File sFile = await bot.MakeRequestAsync(new GetFile(update.Message.Document.FileId));
System.Net.WebClient webclient = new System.Net.WebClient();
var tempfilename = System.IO.Path.GetTempFileName();
webclient.DownloadFile(sFile.FileDownloadUrl, tempfilename);
return Ok();
}

And i get "Request failed (status code 400): Bad Request: wrong persistent file id" error.
I check these codes in Console Application program,They work fine. But in WEBHOOK mode all Message.Document's properties return empty value.
Is there any bug in API, or I made a wrong code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions