Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaherron committed Oct 18, 2024
1 parent 3d87886 commit 146ebe8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions splatchain_discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,31 @@ def reload_db():
print("The database is not loaded. Exiting.")
exit()

reload_db()

# Loading block list from internet if enabled
block_list={}
block_list = {}

def load_block_list():
global block_list
if os.getenv('LBS_BLOCK_LIST') == "true":
print("Loading block list.")
listreq = requests.get("https://littlebitstudios.com/splatchain-block-list.yaml")
block_list = yaml.safe_load(listreq.text)
print(f"Block list loaded: {block_list}")

load_block_list()
def user_block_check(user: discord.User):

def user_block_check(user: discord.User) -> bool:
global block_list
if os.getenv('LBS_BLOCK_LIST') == "true":
if user.name in block_list['blocked_usernames']:
print(f"Checking block list for user: {user.name} (ID: {user.id})")
if user.name in block_list.get('blocked_usernames', []):
return True
if user.id in block_list['blocked_user_ids']:
if user.id in block_list.get('blocked_user_ids', []):
return True
return False

reload_db()

# Detecting duplicates
def detect_duplicates(profiles):
seen_addresses = set()
Expand Down

0 comments on commit 146ebe8

Please sign in to comment.