File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -128,13 +128,23 @@ export class EditMessageActionWithCtx extends EditMessageActionBase<BotTypes> {
128128
129129 let message : Message ;
130130 if ( typeof this . _text === 'string' ) {
131- message = await this . ctx . editMessageText ( this . _text , {
132- parse_mode : this . _parseAsHtml ? 'HTML' as const : undefined ,
133- reply_markup : {
134- inline_keyboard : inlineKeyboard
135- } ,
136- link_preview_options : { is_disabled : this . _disableLinkPreview }
137- } ) as any ;
131+ try {
132+ message = await this . ctx . editMessageText ( this . _text , {
133+ parse_mode : this . _parseAsHtml ? 'HTML' as const : undefined ,
134+ reply_markup : {
135+ inline_keyboard : inlineKeyboard
136+ } ,
137+ link_preview_options : { is_disabled : this . _disableLinkPreview }
138+ } ) as any ;
139+ } catch {
140+ message = await this . ctx . editMessageCaption ( {
141+ caption : this . _text ,
142+ parse_mode : this . _parseAsHtml ? 'HTML' as const : undefined ,
143+ reply_markup : {
144+ inline_keyboard : inlineKeyboard
145+ }
146+ } ) as any ;
147+ }
138148 } else {
139149 message = await this . ctx . editMessageReplyMarkup ( {
140150 reply_markup : {
You can’t perform that action at this time.
0 commit comments