Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed Mar 17, 2020
1 parent cfeea2e commit b9739b6
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion userge/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_help(self, key: str = "") -> Union[str, Dict[str, str]]:
if key and key in self.HELP_DICT:
return self.HELP_DICT[key]
elif key:
return None
return ''
else:
return self.HELP_DICT

Expand Down
6 changes: 5 additions & 1 deletion userge/plugins/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
@userge.on_cmd("eval", about="run eval")
async def eval_(_, message):
await message.edit("Processing ...")
cmd = message.text.split(" ", maxsplit=1)[1]
try:
cmd = message.text.split(" ", maxsplit=1)[1]
except:
await message.edit("__No Command Found!__")

reply_to_id = message.message_id

if message.reply_to_message:
Expand Down
6 changes: 5 additions & 1 deletion userge/plugins/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

@userge.on_cmd("exec", about="run exec")
async def exec_(_, message):
cmd = message.text.split(" ", maxsplit=1)[1]
try:
cmd = message.text.split(" ", maxsplit=1)[1]
except:
await message.edit("__No Command Found!__")

reply_to_id = message.message_id

if message.reply_to_message:
Expand Down
30 changes: 17 additions & 13 deletions userge/plugins/whois.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ async def who_is(_, message):
message_out_str += f"\n"
message_out_str += f"<strong>Permanent Link To Profile:</strong> <a href='tg://user?id={from_user.id}'>{from_user.first_name}</a>"
chat_photo = from_user.photo
local_user_photo = await userge.download_media(
message=chat_photo.big_file_id
)
await message.reply_photo(
photo=local_user_photo,
quote=True,
caption=message_out_str,
parse_mode="html",
# ttl_seconds=,
disable_notification=True
)
os.remove(local_user_photo)
await message.delete()
try:
local_user_photo = await userge.download_media(
message=chat_photo.big_file_id
)
await message.reply_photo(
photo=local_user_photo,
quote=True,
caption=message_out_str,
parse_mode="html",
# ttl_seconds=,
disable_notification=True
)
os.remove(local_user_photo)
await message.delete()
except:
message_out_str = "<b>No DP Found</b>\n\n" + message_out_str
await message.edit(message_out_str, parse_mode="html")

0 comments on commit b9739b6

Please sign in to comment.