If there is no moderators file then create it

master
Bob Mottram 2019-08-11 12:27:29 +01:00
parent 9938be63bf
commit 57f1b99a85
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,9 @@ def addModerator(baseDir: str,nickname: str):
moderator=moderator.strip('\n')
if len(moderator)>1:
f.write(moderator+'\n')
else:
with open(moderatorsFile, "w+") as f:
f.write(nickname+'\n')
def removeModerator(baseDir: str,nickname: str):
"""Removes a moderator nickname from the file