LibreTube/.github/tg.py

25 lines
763 B
Python
Raw Normal View History

2022-06-12 00:47:52 +05:30
import telegram
from tgconfig import TG_TOKEN
2022-06-12 23:11:49 +05:30
from json import load
from time import sleep
f = open('commit.json')
data = load(f)
2022-06-12 23:26:03 +05:30
title = f'''<b>Libretube {data['sha'][0:7]} // Alpha</b>
2022-06-12 23:11:49 +05:30
{data['commit']['message']}
Signed-off-by: {data['commit']['author']['name']} <{data['commit']['author']['email']}>
'''
f.close()
2022-06-12 00:47:52 +05:30
TG_CHAT_ID = "-1001537505605"
2022-06-12 01:35:01 +05:30
bot = telegram.Bot(TG_TOKEN)
2022-06-12 00:47:52 +05:30
2022-06-12 23:26:03 +05:30
bot.send_photo(TG_CHAT_ID, open('alpha.png', 'rb'), title, telegram.ParseMode.HTML)
2022-06-12 00:47:52 +05:30
bot.send_document(TG_CHAT_ID, open('app-arm64-v8a-debug.apk', 'rb'))
bot.send_document(TG_CHAT_ID, open('app-armeabi-v7a-debug.apk', 'rb'))
bot.send_document(TG_CHAT_ID, open('app-x86_64-debug.apk', 'rb'))
bot.send_document(TG_CHAT_ID, open('app-x86-debug.apk', 'rb'))