From b07af72901441f2f4fdbc3fbeaf4f4fd1cf29067 Mon Sep 17 00:00:00 2001 From: trueold89 Date: Mon, 3 Jun 2024 19:01:44 +0300 Subject: [PATCH] Update ENV class - Add CLIENT_ID property --- hellmbot/env.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hellmbot/env.py b/hellmbot/env.py index 04b9701..447ace4 100644 --- a/hellmbot/env.py +++ b/hellmbot/env.py @@ -46,3 +46,16 @@ class ENV(object): if env is None: env = 9 return env + + @property + def CLIENT_ID(self) -> str: + """ + Gets the Discord Client ID from the system environment + + :return: Discord Client ID + """ + env = environ.get("CLIENT_ID") + if env is None: + raise ValueError("client id is not set\nTry to install the system ENV CLIENT_ID\n(export " + "CLIENT_ID=insertyourclientidhere)") + return env