Skip to content
Snippets Groups Projects
Commit c549ea66 authored by Philip Maas's avatar Philip Maas
Browse files

Minor refactoring

parent 2b4edc4d
Branches
No related tags found
1 merge request!4Die Funktionalität der Events ist nun implementiert und funktioniert analaog...
......@@ -16,7 +16,7 @@ class Birthday:
return self.PERSON == other.PERSON and self.DATE == other.DATE
def get_congratulation(self):
return f"Alles Gute {self.PERSON}"
return f"Alles Gute {self.PERSON}"
def get_csv_line(self):
return f"{self.PERSON},{self.DATE}"
......
......@@ -121,29 +121,27 @@ def load_config(filename):
GROUPS = CONFIG["GROUPS"]
except FileNotFoundError:
log.error(f"File:'{filename}' not accessible")
log.error(f"File:'{filename}' not accessible. Running in reduced mode.")
print("File not accessible")
print("Running in reduced mode")
def handle_action(timestamp, source, groupID, message, attachments):
print("msgRcv called")
if not (message.startswith(".") and len(message) >= 2):
return
print(timestamp)
print(source)
print(groupID)
print(message)
print(attachments)
receiver = source
if len(groupID) > 0:
receiver = groupID
receiver = groupID if len(groupID) > 0 else source
try:
if message.startswith(".") and len(message) >= 2:
message = message[1:].strip()
msg_splitted = message.split(" ")
action = msg_splitted[0].lower()
if len(action) > 0:
if len(action) == 0:
return
if action == "help":
help_func(receiver, " ".join(str(x) for x in msg_splitted[1:]).strip())
elif action == "remusfeinste":
......@@ -263,7 +261,6 @@ def links(password, receiver):
message = "Keine Links hinterlegt!"
elif password.lower() == NTP_PASSWORD:
message = ""
if len(NTP_LINKS) > 0:
for key, value in NTP_LINKS.items():
if type(value) is str:
message += key + ":\n" # Gruppenname / Linkbezeichnung
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment