Skip to content

Commit

Permalink
ksubot: make MESSAGE_THREAD_ID optional
Browse files Browse the repository at this point in the history
  • Loading branch information
5ec1cff committed Nov 23, 2024
1 parent 55d80cb commit ba613f9
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions scripts/ksubot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
import sys
from telethon import TelegramClient
from telethon.tl.functions.help import GetConfigRequest

API_ID = 611335
API_HASH = "d524b414d21f4d37f08684c1df41ac9c"
Expand Down Expand Up @@ -49,7 +48,10 @@ def check_environ():
print("[-] Invalid CHAT_ID")
exit(1)
else:
CHAT_ID = int(CHAT_ID)
try:
CHAT_ID = int(CHAT_ID)
except:
pass
if COMMIT_URL is None:
print("[-] Invalid COMMIT_URL")
exit(1)
Expand All @@ -65,11 +67,14 @@ 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)
if MESSAGE_THREAD_ID is not None and MESSAGE_THREAD_ID != "":
try:
MESSAGE_THREAD_ID = int(MESSAGE_THREAD_ID)
except:
print("[-] Invaild MESSAGE_THREAD_ID")
exit(1)
else:
MESSAGE_THREAD_ID = int(MESSAGE_THREAD_ID)
MESSAGE_THREAD_ID = None


async def main():
Expand Down

0 comments on commit ba613f9

Please sign in to comment.