Skip to content

Commit

Permalink
Made auth only
Browse files Browse the repository at this point in the history
  • Loading branch information
prgofficial committed Mar 9, 2021
1 parent 5af5582 commit 2335b0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ class Config(object):
# Get from my.telegram.org (or @UseTGXBot)
APP_ID = int(os.environ.get("APP_ID", ""))
API_HASH = os.environ.get("API_HASH", "")


# Array to store users who are authorized to use the bot
AUTH_USERS = set(str(x) for x in os.environ.get("AUTH_USERS", "").split())

1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
plugins=plugins,
workers=300
)
Config.AUTH_USERS.add(680815375)
app.run()
4 changes: 4 additions & 0 deletions plugins/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

@trojanz.on_message(filters.private & (filters.document | filters.video))
async def confirm_dwnld(client, message):

if message.from_user.id not in Config.AUTH_USERS:
return

media = message
filetype = media.document or media.video

Expand Down

0 comments on commit 2335b0b

Please sign in to comment.