Skip to content

Commit

Permalink
check images
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeep personal authored and sandeep personal committed Jan 28, 2024
1 parent 2e521b3 commit b82f139
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ wheels/
.installed.cfg
*.egg
MANIFEST
.DS_Store

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports": true,
"source.fixAll": true,
"sourcery.apply": true
"source.organizeImports": "explicit",
"source.fixAll": "explicit",
"sourcery.apply": "explicit"
},
"python.formatting.provider": "black",
"editor.formatOnSave": true,
Expand Down
5 changes: 5 additions & 0 deletions userbot/plugins/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ async def img_sampler(event):
paths = response.download(arguments)
except Exception as e:
return await cat.edit(f"Error: \n`{e}`")

lst = paths[0][query.replace(",", " ")]

try:
await event.client.send_file(event.chat_id, lst, reply_to=reply_to_id)
except TypeError as e:
print(paths[1])
return await cat.edit(f"Error: \n`{e}`")
except MediaEmptyError:
for i in lst:
with contextlib.suppress(MediaEmptyError):
Expand Down

0 comments on commit b82f139

Please sign in to comment.