Getting petname

main
Bob Mottram 2021-06-30 14:06:48 +01:00
parent 4f575e8316
commit 36303ab578
1 changed files with 3 additions and 2 deletions

View File

@ -79,8 +79,9 @@ def getPetName(baseDir: str, nickname: str, domain: str,
petnamesList = petnamesStr.split('\n')
handle = handle.lower()
for pet in petnamesList:
if pet.endswith(' ' + handle):
return pet.replace(' ' + handle, '').strip()
if pet.lower().endswith(' ' + handle):
handle2 = pet.split(' ')[-1]
return pet.replace(' ' + handle2, '').strip()
return ''