add ping check for heroku

This commit is contained in:
BennyThink 2021-08-30 22:06:32 +08:00
parent b7733fbc9f
commit 6a76d832f8
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481
3 changed files with 20 additions and 11 deletions

View File

@ -1,6 +1,6 @@
# ytdlbot
YouTube Download🚀
YouTube Download Bot🚀
Download videos from YouTube and other platforms through a Telegram Bot

View File

@ -1,7 +1,7 @@
{
"name": "YouTube-Downloader",
"description": "A Telegrambot to download youtube video",
"repository": "https://github.com/tgbot-collection/ytdl-bot",
"repository": "https://github.com/tgbot-collection/ytdlbot",
"logo": "https://avatars.githubusercontent.com/u/73354211?s=200&v=4",
"keywords": [
"telegram",
@ -10,22 +10,31 @@
"env": {
"TOKEN": {
"description": "Bot token",
"value": "bot32313"
"value": "token"
},
"APP_ID": {
"description": "APP_ID",
"value": "5155161"
"description": "APP ID",
"value": "12345"
},
"APP_HASH": {
"description": "APP_HASH",
"value": "3131"
"description": "APP HASH",
"value": "12345abc"
},
"OWNER": {
"description": "Your telegram username",
"value": "username",
"required": false
}
},
"formation": {
"worker": {
"quantity": 1,
"size": "free"
}
}
},
"buildpacks": [
{
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git"
}
]
}

View File

@ -77,8 +77,8 @@ def help_handler(client: "Client", message: "types.Message"):
def ping_handler(client: "Client", message: "types.Message"):
chat_id = message.chat.id
client.send_chat_action(chat_id, "typing")
if os.uname().sysname == "Darwin":
bot_info = "test"
if os.uname().sysname == "Darwin" or ".heroku" in os.getenv("PYTHONHOME", ""):
bot_info = "ping unavailable."
else:
bot_info = get_runtime("botsrunner_ytdl_1", "YouTube-dl")
if message.chat.username == OWNER: