Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getFile give an error in webhook mode #65

Open
alireza-pishbin opened this issue Dec 23, 2017 · 0 comments
Open

getFile give an error in webhook mode #65

alireza-pishbin opened this issue Dec 23, 2017 · 0 comments

Comments

@alireza-pishbin
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant