From 3dce5ec62358f8498373e1ecca92bd7e62da3fa8 Mon Sep 17 00:00:00 2001 From: Specoolazius Date: Wed, 30 Mar 2022 21:46:20 +0200 Subject: [PATCH] made config immutable --- bot/{client.py => botclient.py} | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) rename bot/{client.py => botclient.py} (93%) diff --git a/bot/client.py b/bot/botclient.py similarity index 93% rename from bot/client.py rename to bot/botclient.py index 338500c..5f92700 100644 --- a/bot/client.py +++ b/bot/botclient.py @@ -102,7 +102,19 @@ class Client(discord.Bot, ABC): Starts the bot and automatically gets the configured token. """ - super(Client, self).run(self.__config.auth_token) + super(BotClient, self).run(self.__config.auth_token) + + @property + def config(self) -> Configs: + """< property > + + The default config should not be changeable even on runtime. + This ensures its read-only. + + :return: Butter default config + """ + + return self.__config @property def color(self) -> int: