Skip to content

Navigation Menu

Sign in
Sign up

Commit 01e0938

Browse files
committed
merge isBot::black_key and isBot::blacklist as one
all use re.search instead
1 parent b8a652b commit 01e0938

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎stats_helper/utils.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def name_to_uuid_fromAPI(name):
1616

1717
def isBot(name: str):
1818
name = name.upper()
19-
blacklist = 'A_Pi#nw#sw#SE#ne#nf#SandWall#storage#Steve#Alex#DuperMaster#Nya_Vanilla#Witch#Klio_5#######'.upper()
20-
black_keys= [r'farm', r'bot_', r'cam', r'_b_', r'bot-', r'bot\d', r'^bot']
21-
if blacklist.find(name) >=0orlen(name) < 4 or len(name) > 16:
19+
black_keys = [r'farm', r'bot_', r'cam', r'_b_', r'bot-', r'bot\d', r'^bot', r'A_Pi', r'nw', r'sw', r'SE',
20+
r'ne', r'nf', r'SandWall', r'storage', r'Steve', r'Alex', r'DuperMaster', r'Nya_Vanilla', r'Witch', r'Klio_5']
21+
if len(name) < 4 or len(name) > 16:
2222
return True
2323
for black_key in black_keys:
2424
if re.search(black_key.upper(), name):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /