From 57f1b99a85229ffc6fcffe220cd08fe56697dad6 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 11 Aug 2019 12:27:29 +0100 Subject: [PATCH] If there is no moderators file then create it --- roles.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles.py b/roles.py index de60d9473..bc92fe1c9 100644 --- a/roles.py +++ b/roles.py @@ -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