Updated to 4.0.0

This commit is contained in:
Fr4nz D13trich 2025-11-20 21:24:53 +01:00
parent b7554a5383
commit 938198bf11
234 changed files with 21069 additions and 12710 deletions

View file

@ -2,6 +2,7 @@ import asyncio
import os
import sys
from telethon import TelegramClient
from telethon.sessions import StringSession
API_ID = 611335
API_HASH = "d524b414d21f4d37f08684c1df41ac9c"
@ -15,8 +16,10 @@ COMMIT_MESSAGE = os.environ.get("COMMIT_MESSAGE")
RUN_URL = os.environ.get("RUN_URL")
TITLE = os.environ.get("TITLE")
VERSION = os.environ.get("VERSION")
BRANCH = os.environ.get("BRANCH")
MSG_TEMPLATE = """
**{title}**
Branch: {branch}
#ci_{version}
```
{commit_message}
@ -29,6 +32,7 @@ MSG_TEMPLATE = """
def get_caption():
msg = MSG_TEMPLATE.format(
title=TITLE,
branch=BRANCH,
version=VERSION,
commit_message=COMMIT_MESSAGE,
commit_url=COMMIT_URL,
@ -67,11 +71,14 @@ def check_environ():
if VERSION is None:
print("[-] Invalid VERSION")
exit(1)
if MESSAGE_THREAD_ID is not None and MESSAGE_THREAD_ID != "":
if BRANCH is None:
print("[-] Invalid BRANCH")
exit(1)
if MESSAGE_THREAD_ID and MESSAGE_THREAD_ID != "":
try:
MESSAGE_THREAD_ID = int(MESSAGE_THREAD_ID)
except:
print("[-] Invaild MESSAGE_THREAD_ID")
print("[-] Invalid MESSAGE_THREAD_ID")
exit(1)
else:
MESSAGE_THREAD_ID = None
@ -86,9 +93,7 @@ async def main():
print("[-] No files to upload")
exit(1)
print("[+] Logging in Telegram with bot")
script_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
session_dir = os.path.join(script_dir, "ksubot")
async with await TelegramClient(session=session_dir, api_id=API_ID, api_hash=API_HASH).start(bot_token=BOT_TOKEN) as bot:
async with await TelegramClient(StringSession(), API_ID, API_HASH).start(bot_token=BOT_TOKEN) as bot:
caption = [""] * len(files)
caption[-1] = get_caption()
print("[+] Caption: ")