Messi doesn't have a publicly available API for this kind of thing (as far as I'm aware), but you can fake a click on the close (or OK buttons) like this:
If you have shown the close button:
$(".messi-closebtn")[0].click();
Or if you don't have a close button, trigger the click on whichever custom button you need:
$(".messi .btn")[0].click();