Fix get_entities_text with cls (#866)

This commit is contained in:
chrizrobert 2018-06-26 21:58:55 +08:00 committed by Lonami
parent dbb81173fa
commit 1eb4af33df

View File

@ -604,16 +604,12 @@ class Message:
if not self.original_message.entities: if not self.original_message.entities:
return [] return []
if cls and self.original_message.entities: ent = self.original_message.entities
texts = get_inner_text( if cls and ent:
self.original_message.message, ent = [c for c in ent if isinstance(c, cls)]
[c for c in self.original_message.entities
if isinstance(c, cls)] texts = get_inner_text(self.original_message.message, ent)
) return list(zip(ent, texts))
else:
texts = get_inner_text(self.original_message.message,
self.original_message.entities)
return list(zip(self.original_message.entities, texts))
async def click(self, i=None, j=None, *, text=None, filter=None): async def click(self, i=None, j=None, *, text=None, filter=None):
""" """