mirror of
https://github.com/omg-xtao/ytdlbot.git
synced 2024-11-16 03:45:23 +00:00
add custom text
This commit is contained in:
parent
5c66b15b51
commit
30195dba3f
@ -7,6 +7,7 @@
|
||||
|
||||
__author__ = "Benny <benny.think@gmail.com>"
|
||||
|
||||
import os
|
||||
import time
|
||||
|
||||
from config import (AFD_LINK, COFFEE_LINK, ENABLE_CELERY, ENABLE_VIP, EX,
|
||||
@ -91,6 +92,7 @@ Your current settings:
|
||||
Video quality: **{0}**
|
||||
Sending format: **{1}**
|
||||
"""
|
||||
custom_text = os.getenv("CUSTOM_TEXT", "")
|
||||
|
||||
def remaining_quota_caption(self, chat_id):
|
||||
if not ENABLE_VIP:
|
||||
|
@ -341,7 +341,7 @@ def gen_cap(chat_id, url, video_path):
|
||||
remain = bot_text.remaining_quota_caption(chat_id)
|
||||
worker = get_dl_source()
|
||||
cap = f"`{file_name}`\n\n{url}\n\nInfo: {meta['width']}x{meta['height']} {file_size}\t" \
|
||||
f"{meta['duration']}s\n{remain}\n{worker}"
|
||||
f"{meta['duration']}s\n{remain}\n{worker}\n{bot_text.custom_text}"
|
||||
return cap, meta
|
||||
|
||||
|
||||
|
@ -85,7 +85,8 @@ def start_handler(client: "Client", message: "types.Message"):
|
||||
client.send_chat_action(from_id, "typing")
|
||||
greeting = bot_text.get_vip_greeting(from_id)
|
||||
quota = bot_text.remaining_quota_caption(from_id)
|
||||
text = f"{greeting}{bot_text.start}\n\n{quota}"
|
||||
custom_text = bot_text.custom_text
|
||||
text = f"{greeting}{bot_text.start}\n\n{quota}\n{custom_text}"
|
||||
|
||||
client.send_message(message.chat.id, text)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user