title: How to know count or last of messages in MediaGroup telegram
body: <p>I want to attach a button for a media group</p>
  <ol>
  <li><p>To do this, I intercept the message and see if there is the same mediaGroup_id, then I save the file_id to the database</p>
  </li>
  <li><p>After all messages from this media group have been received, I send them to a group in a separate channel (here is the problem) -&gt; <em>how can I determine that this is the last message from the media group, I had a stupid idea to create a job with a delay of several seconds, enough time to receive the entire media group, and then send the entire media group in this job, however, I am worried about the reliability of this method, and for sure it will be buggy if one day I have to use asynchronous</em></p>
  </li>
  <li><p>Then, in the main channel, I send a message containing a link to the media group and a button, as I wanted</p>
  </li>
  </ol>
  <p>Is there some way to do this more elegantly?</p>