Skip to content

Commit

Permalink
delete message if not auth
Browse files Browse the repository at this point in the history
  • Loading branch information
hlf20010508 committed Jun 29, 2023
1 parent a6d2396 commit aba38d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def upload(local_path):
onedrive_bot = await tg_client.get_entity("@%s" % onedrive_bot.username)
except:
await event.respond("You haven't logined to Telegram.\nUse /auth to login.")
await event.delete()
raise events.StopPropagation
iter_messages = tg_client.iter_messages(onedrive_bot)
if "document" in event.media.to_dict().keys():
Expand Down Expand Up @@ -245,6 +246,7 @@ def upload(local_path):
message = await tg_client.get_messages(chat, ids=msg_id)
except:
await event.respond("You haven't logined to Telegram.\nUse /auth to login.")
await event.delete()
raise events.StopPropagation
if "document" in message.media.to_dict().keys():
name = "%d%s" % (message.media.document.id, message.file.ext)
Expand Down

0 comments on commit aba38d2

Please sign in to comment.