add custom text

This commit is contained in:
BennyThink 2022-02-27 10:47:54 +08:00
parent 5c66b15b51
commit 30195dba3f
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481
3 changed files with 5 additions and 2 deletions

View File

@ -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:

View File

@ -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

View File

@ -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)