Skip to content

Commit

Permalink
Auth users removed
Browse files Browse the repository at this point in the history
Session user can only use this bot.! (Moulding as a single user bot).
  • Loading branch information
m4mallu committed Sep 18, 2022
1 parent 32dd931 commit 9fd0057
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"API_HASH": {"description": "Get this value from https://my.telegram.org" , "required": true},
"TG_BOT_TOKEN": {"description": "Get Bot Token From BotFather Bot","required": true},
"TG_USER_SESSION": {"description": "String Session from an admin user. Go to: t.ly/GxsB ","required": true},
"AUTH_USERS": {"description": "User ids of authorized users separated by space", "required": false},
"ENV": {"description": "Set this to ANYTHING","value": "ANYTHING"}
},
"addons": [
Expand Down
1 change: 0 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def __init__(self):
async def start(self):
await super().start()
usr_bot_me = await self.get_me()
bot_me = self.USER_ID
self.set_parse_mode(ParseMode.HTML)
self.LOGGER(__name__).info(
f"@{usr_bot_me.username} started! "
Expand Down
3 changes: 2 additions & 1 deletion plugins/cb_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@

@Client.on_callback_query(filters.regex(r'^start_btn$'))
async def start_settings(client: Bot, cb: CallbackQuery):
user = await Bot.get_me(self=client.USER)
id = int(cb.from_user.id)
if Config.AUTH_USERS and (id not in Config.AUTH_USERS):
if id != int(user.id):
await cb.answer(Presets.NOT_AUTH_TEXT, show_alert=True)
return
await add_user(id)
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions sample_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ class Config(object):
# Get from my.telegram.org
API_HASH = os.environ.get("API_HASH", "")

# Authorized users to use this bot
AUTH_USERS = set(int(x) for x in os.environ.get("AUTH_USERS", "").split())

# Generate a user session string
TG_USER_SESSION = os.environ.get("TG_USER_SESSION", "")

Expand Down

0 comments on commit 9fd0057

Please sign in to comment.