Catch Telegraph acc creation Error.

This commit is contained in:
thedragonsinn
2023-12-15 15:12:55 +05:30
parent a3d3d51850
commit 90d663b00b

View File

@@ -1,23 +1,26 @@
import os
import time
from pyrogram.types import Message, User
from telegraph.aio import Telegraph
from app import Config
from app import Config, LOGGER
from app.utils.media_helper import bytes_to_mb
TELEGRAPH: None | Telegraph = None
PROGRESS_DICT = {}
"""
async def init_task():
global TELEGRAPH
TELEGRAPH = Telegraph()
await TELEGRAPH.create_account(
short_name="Plain-UB", author_name="Plain-UB", author_url=Config.UPSTREAM_REPO
)
"""
try:
await TELEGRAPH.create_account(
short_name="Plain-UB", author_name="Plain-UB", author_url=Config.UPSTREAM_REPO
)
except Exception as e:
LOGGER.error("Failed to Create Telegraph Account.")
async def post_to_telegraph(title: str, text: str):
telegraph = await TELEGRAPH.create_page(