Catch Telegraph acc creation Error.
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user