Skip to content

Instantly share code, notes, and snippets.

@New-dev0
Last active October 21, 2022 15:40
Show Gist options
  • Save New-dev0/786db329d630cc09f4f3cbc18345ed44 to your computer and use it in GitHub Desktop.
Save New-dev0/786db329d630cc09f4f3cbc18345ed44 to your computer and use it in GitHub Desktop.
import os
from telethon.sync import TelegramClient
from glob import glob
chat_id=-1001237141420
client = TelegramClient(None, api_id=6, api_hash="eb06d4abfb49dc3eeb1aeb98ae0f581e")
files = "android/app/build/outputs/apk/"
path = glob(files + "*/*.apk")
if not path:
if os.path.exists(files + "release/app-release.apk"):
path = files + "release/app-release.apk"
elif os.path.exists(files + "debug/app-debug.apk"):
path = files + "debug/app-debug.apk"
else:
path = files + os.listdir(files)[-1]
path = glob(path + "/*")
with client.start(bot_token=os.environ.get("BOT_TOKEN")) as bot:
bot.send_message(chat_id, "Enviro Build", file=path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment