17 lines
468 B
Python
17 lines
468 B
Python
|
import asyncio
|
||
|
|
||
|
from telegraph.aio import Telegraph
|
||
|
import config
|
||
|
|
||
|
telegraph = Telegraph(config.ACCOUNT["access_token"])
|
||
|
|
||
|
|
||
|
async def create_new_account(short_name: str) -> dict:
|
||
|
account = await telegraph.create_account(short_name=short_name)
|
||
|
print(account)
|
||
|
|
||
|
|
||
|
async def create_post(title: str, content: str) -> dict:
|
||
|
new_article = await telegraph.create_page(title=title, html_content=content)
|
||
|
print("https://telegra.ph/{}".format(new_article["path"]))
|