fix(client): hopefully fix random MEDIA_EMPTY errors when editing inline

This commit is contained in:
teidesu 2022-07-10 01:38:23 +03:00
parent 715f4f8a68
commit 2c54751029

View file

@ -97,16 +97,28 @@ export async function editInlineMessage(
) )
} }
await this.call( let retries = 3
{ while (retries--) {
_: 'messages.editInlineBotMessage', try {
id, await this.call(
noWebpage: params.disableWebPreview, {
replyMarkup: BotKeyboard._convertToTl(params.replyMarkup), _: 'messages.editInlineBotMessage',
message: content, id,
entities, noWebpage: params.disableWebPreview,
media, replyMarkup: BotKeyboard._convertToTl(params.replyMarkup),
}, message: content,
{ connection } entities,
) media,
},
{ connection }
)
return
} catch (e) {
if (e instanceof tl.errors.MediaEmptyError) {
continue
}
throw e
}
}
} }