fix(client): hopefully fix random MEDIA_EMPTY errors when editing inline
This commit is contained in:
parent
715f4f8a68
commit
2c54751029
1 changed files with 24 additions and 12 deletions
|
@ -97,16 +97,28 @@ export async function editInlineMessage(
|
|||
)
|
||||
}
|
||||
|
||||
await this.call(
|
||||
{
|
||||
_: 'messages.editInlineBotMessage',
|
||||
id,
|
||||
noWebpage: params.disableWebPreview,
|
||||
replyMarkup: BotKeyboard._convertToTl(params.replyMarkup),
|
||||
message: content,
|
||||
entities,
|
||||
media,
|
||||
},
|
||||
{ connection }
|
||||
)
|
||||
let retries = 3
|
||||
while (retries--) {
|
||||
try {
|
||||
await this.call(
|
||||
{
|
||||
_: 'messages.editInlineBotMessage',
|
||||
id,
|
||||
noWebpage: params.disableWebPreview,
|
||||
replyMarkup: BotKeyboard._convertToTl(params.replyMarkup),
|
||||
message: content,
|
||||
entities,
|
||||
media,
|
||||
},
|
||||
{ connection }
|
||||
)
|
||||
return
|
||||
} catch (e) {
|
||||
if (e instanceof tl.errors.MediaEmptyError) {
|
||||
continue
|
||||
}
|
||||
|
||||
throw e
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue