WTelegramClient giving FILE_PART_X_MISSING error when sending image

38 views Asked by At

I am using WTelegramClient library for making client for Telegram messenger.

My goal is to send message with image every one hour to selected group. When I leave computer untouched the code gives this error:

TL.RpcException: 400 FILE_PART_X_MISSING,

but if I use my PC while code running it won't give any errors. Could it be a problem related to Windows 11, where certain operations or file accesses may be paused or slowed down to conserve power or resources? Here's my code:

var chats = await client.Messages_GetAllChats();
var messageImage = await client.UploadFileAsync(@"C:\...\image.jpg");

while (true) {
    await client.SendMediaAsync(chats.chats[my_group_id], "Text for the message", messageImage);
    await Task.Delay(TimeSpan.FromHours(1)); /* I need message to be send every 1 hour */
}

I also tried sending a message without an image, and that worked without any errors.

1

There are 1 answers

0
Wizou On

Maybe your uploaded image got deleted server-side somehow (especially if it's spam your sending)

I don't think it's related to your PC activity. If possible you may edit your question to add some WTC logs, it would help to analyze the problem.

As a workaround, you can try to reupload the image when this error happens.