Skip to content

Commit

Permalink
feat: Added a whitelist for users
Browse files Browse the repository at this point in the history
  • Loading branch information
dom6770 committed Aug 7, 2024
1 parent 06d8809 commit a91904b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit a91904b

Please sign in to comment.