async def rank(self):
from bernard.platforms.facebook import layers as fbl<EOL>choices = self.request.get_trans_reg('<STR_LIT>')<EOL>if not choices:<EOL><INDENT>return<EOL><DEDENT>if self.request.has_layer(fbl.QuickReply):<EOL><INDENT>return self._rank_qr(choices)<EOL><DEDENT>elif self.request.has_layer(l.RawText):<EOL><INDENT>return await self._rank_text(choices)<EOL><DEDENT>
Try to find a choice in what the user did:

- If there is a quick reply, then use its payload as choice slug
- Otherwise, try to match each choice with its intent