diff --git a/src/run.py b/src/run.py index c0ad3ea..cc6ed77 100644 --- a/src/run.py +++ b/src/run.py @@ -9,6 +9,7 @@ # Set up your bot token and other variables from the environment BOT_TOKEN = os.getenv('BOT_TOKEN') TRIGGER_WORDS = os.getenv('TRIGGER_WORDS').split(',') +WHITELIST = os.getenv('WHITELIST').split(',') STATS_FILE = os.getenv('STATS_FILE') RESPONSE_MESSAGE = os.getenv('RESPONSE_MESSAGE') @@ -61,6 +62,10 @@ async def handle_response(update: Update, context: CallbackContext, target_usern print(f"Group {group_id} - Target: {target_username}") + # Skip if user is on whitelist + if target_username in WHITELIST: + return + # Load the statistics statistics = load_statistics()