diff --git a/scripts/ksubot.py b/scripts/ksubot.py index 45c9c2bd0eff..5cd098e3d3bc 100644 --- a/scripts/ksubot.py +++ b/scripts/ksubot.py @@ -9,8 +9,8 @@ BOT_TOKEN = os.environ.get("BOT_TOKEN") -CHAT_ID = int(os.environ.get("CHAT_ID")) -MESSAGE_THREAD_ID = int(os.environ.get("MESSAGE_THREAD_ID")) +CHAT_ID = os.environ.get("CHAT_ID") +MESSAGE_THREAD_ID = os.environ.get("MESSAGE_THREAD_ID") COMMIT_URL = os.environ.get("COMMIT_URL") COMMIT_MESSAGE = os.environ.get("COMMIT_MESSAGE") RUN_URL = os.environ.get("RUN_URL") @@ -47,6 +47,8 @@ def check_environ(): if CHAT_ID is None: print("[-] Invalid CHAT_ID") exit(1) + else: + CHAT_ID = int(CHAT_ID) if COMMIT_URL is None: print("[-] Invalid COMMIT_URL") exit(1) @@ -62,6 +64,11 @@ def check_environ(): if VERSION is None: print("[-] Invalid VERSION") exit(1) + if MESSAGE_THREAD_ID is None: + print("[-] Invaild MESSAGE_THREAD_ID") + exit(1) + else: + MESSAGE_THREAD_ID = int(MESSAGE_THREAD_ID) async def main():