diff --git a/app.json b/app.json index 26682b1..8ddd335 100755 --- a/app.json +++ b/app.json @@ -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": [ diff --git a/bot.py b/bot.py index 22710a6..93b8134 100755 --- a/bot.py +++ b/bot.py @@ -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! " diff --git a/plugins/cb_button.py b/plugins/cb_button.py index a877cc1..1d6de39 100755 --- a/plugins/cb_button.py +++ b/plugins/cb_button.py @@ -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) diff --git a/run b/run.bat similarity index 100% rename from run rename to run.bat diff --git a/sample_config.py b/sample_config.py index f62b748..f5cd2ca 100755 --- a/sample_config.py +++ b/sample_config.py @@ -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", "")