diff --git a/royalnet/__main__.py b/royalnet/__main__.py index 03b18e9a..11024b86 100644 --- a/royalnet/__main__.py +++ b/royalnet/__main__.py @@ -58,7 +58,7 @@ def run(config_filename: str): # Serfs telegram_process = None - if config["Serfs"]["Telegram"]["enabled"]: + if "Telegram" in config["Serfs"] and config["Serfs"]["Telegram"]["enabled"]: telegram_process = multiprocessing.Process(name="Serf.Telegram", target=rs.telegram.TelegramSerf.run_process, daemon=True, @@ -76,7 +76,7 @@ def run(config_filename: str): log.info("Serf.Telegram: Disabled") discord_process = None - if config["Serfs"]["Discord"]["enabled"]: + if "Discord" in config["Serfs"] and config["Serfs"]["Discord"]["enabled"]: discord_process = multiprocessing.Process(name="Serf.Discord", target=rs.discord.DiscordSerf.run_process, daemon=True, @@ -94,7 +94,7 @@ def run(config_filename: str): log.info("Serf.Discord: Disabled") matrix_process = None - if config["Serfs"]["Matrix"]["enabled"]: + if "Matrix" in config["Serfs"] and config["Serfs"]["Matrix"]["enabled"]: matrix_process = multiprocessing.Process(name="Serf.Matrix", target=rs.matrix.MatrixSerf.run_process, daemon=True, diff --git a/royalnet/serf/matrix/matrixserf.py b/royalnet/serf/matrix/matrixserf.py index c36dd3cd..adf3f8a0 100644 --- a/royalnet/serf/matrix/matrixserf.py +++ b/royalnet/serf/matrix/matrixserf.py @@ -95,7 +95,7 @@ class MatrixSerf(Serf): return DiscordData - async def handle_message(self, room: nio.MatrixRoom, event: nio.RoomMessageText): + async def handle_message(self, room: "nio.MatrixRoom", event: "nio.RoomMessageText"): # Skip events happened before the startup of the Serf if event.server_timestamp < self._started_timestamp: return