@@ -24,7 +24,8 @@ const reportHandler = async ctx => {
2424 // Ignore monospaced reports
2525 if ( ctx . message . entities ?. [ 0 ] ?. type === 'code' && ctx . message . entities [ 0 ] . offset === 0 )
2626 return null ;
27- if ( ! ctx . message . reply_to_message ) {
27+ const reply = ctx . message . reply_to_message ;
28+ if ( ! reply ) {
2829 await ctx . deleteMessage ( ) ;
2930 return ctx . replyWithHTML (
3031 'ℹ️ <b>Reply to the message you\'d like to report</b>' ,
@@ -34,19 +35,21 @@ const reportHandler = async ctx => {
3435 . filter ( isQualified )
3536 . map ( adminMention ) ;
3637 // eslint-disable-next-line max-len
37- const s = TgHtml . tag `❗️ <b>Message from ${ link ( ctx . message . reply_to_message . from ) } was reported to the admins</b>.${ TgHtml . join ( '' , admins ) } ` ;
38+ const s = TgHtml . tag `❗️ <b>Message from ${ link ( reply . from ) } was reported to the admins</b>.${ TgHtml . join ( '' , admins ) } ` ;
3839 const report = await ctx . replyWithHTML ( s , {
39- reply_to_message_id : ctx . message . reply_to_message . message_id ,
40+ reply_to_message_id : reply . message_id ,
4041 } ) ;
4142 if ( chats . report ) {
43+ const msg = await ctx . telegram . forwardMessage ( chats . report , ctx . chat . id , reply . message_id ) ;
4244 await ctx . deleteMessage ( ) ;
4345 await ctx . telegram . sendMessage (
4446 chats . report ,
4547 TgHtml . tag `❗️ ${ link ( ctx . from ) } reported <a href="${ msgLink (
46- ctx . message . reply_to_message ,
47- ) } ">a message</a> from ${ link ( ctx . message . reply_to_message . from ) } in ${ ctx . chat . title } !`,
48+ reply ,
49+ ) } ">a message</a> from ${ link ( reply . from ) } in ${ ctx . chat . title } !`,
4850 {
4951 parse_mode : 'HTML' ,
52+ reply_to_message_id : msg . message_id ,
5053 reply_markup : { inline_keyboard : [ [ {
5154 text : '✔️ Handled' ,
5255 callback_data : Cmd . stringify ( {
0 commit comments