2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-31 14:38:04 +00:00

improve get_image

This commit is contained in:
Nick80835
2020-05-09 12:22:02 -04:00
parent 6633d63340
commit 9413f609ab

View File

@@ -90,22 +90,18 @@ class Loader():
async def get_image(self, event):
if event and event.media:
if event.photo:
data = event.photo
return event.photo
elif event.document:
if DocumentAttributeFilename(file_name='AnimatedSticker.tgs') in event.media.document.attributes:
return False
return None
if event.gif or event.video or event.audio or event.voice:
return False
data = event.media.document
else:
return False
else:
return False
return None
if not data or data is None:
return False
return event.media.document
else:
return None
else:
return data
return None
def _find_all_modules(self):
mod_paths = glob.glob(dirname(__file__) + "/modules/*.py")