code: async def _replace_with_mention(self, entities, i, user):
          
          try:
              entities[i] = types.InputMessageEntityMentionName(
                  entities[i].offset, entities[i].length,
                  await self.get_input_entity(user)
              )
              return True            
          except (ValueError, TypeError):
              return False
docs: Helper method to replace ``entities[i]`` to mention ``user``,
          or do nothing if it can't be found.