mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-03 11:04:51 +00:00
Fix
This commit is contained in:
parent
91d937fcae
commit
fccae5731d
4 changed files with 6 additions and 5 deletions
|
|
@ -9,6 +9,7 @@ session = ClientSession()
|
||||||
# HTTPx Async Client
|
# HTTPx Async Client
|
||||||
http = httpx.AsyncClient(
|
http = httpx.AsyncClient(
|
||||||
http2=True,
|
http2=True,
|
||||||
|
verify=False,
|
||||||
timeout=httpx.Timeout(40),
|
timeout=httpx.Timeout(40),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ import os
|
||||||
import shlex
|
import shlex
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
|
from misskaty import BOT_USERNAME
|
||||||
from telegraph.aio import Telegraph
|
from telegraph.aio import Telegraph
|
||||||
from utils import LOGGER
|
from utils import LOGGER
|
||||||
|
|
||||||
|
|
||||||
async def post_to_telegraph(is_media: bool, title=None, content=None, media=None):
|
async def post_to_telegraph(is_media: bool, title=None, content=None, media=None):
|
||||||
telegraph = Telegraph()
|
telegraph = Telegraph()
|
||||||
await telegraph.create_account(short_name='MissKaty')
|
|
||||||
if is_media:
|
if is_media:
|
||||||
"""Create a Telegram Post Foto/Video"""
|
"""Create a Telegram Post Foto/Video"""
|
||||||
response = await telegraph.upload_file(media)
|
response = await telegraph.upload_file(media)
|
||||||
|
|
@ -18,8 +18,8 @@ async def post_to_telegraph(is_media: bool, title=None, content=None, media=None
|
||||||
response = await telegraph.create_page(
|
response = await telegraph.create_page(
|
||||||
title,
|
title,
|
||||||
html_content=content,
|
html_content=content,
|
||||||
author_url="https://t.me/MissKatyPyro",
|
author_url=f"https://t.me/{BOT_USERNAME}",
|
||||||
author_name="MissKatyBot"
|
author_name=BOT_USERNAME
|
||||||
)
|
)
|
||||||
return response['url']
|
return response['url']
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ async def telegraph_paste(_, message):
|
||||||
return await editPesan(msg, "`File Not Supported !`")
|
return await editPesan(msg, "`File Not Supported !`")
|
||||||
elif reply and (reply.text or reply.caption):
|
elif reply and (reply.text or reply.caption):
|
||||||
title = message.text.split(None, 1)[1] if len(message.command) > 1 else "MissKaty Paste"
|
title = message.text.split(None, 1)[1] if len(message.command) > 1 else "MissKaty Paste"
|
||||||
data = reply.text.html or reply.caption.html
|
data = reply.text.html.replace("\n", "<br>") or reply.caption.html.replace("\n", "<br>")
|
||||||
elif not reply and len(message.command) >= 2:
|
elif not reply and len(message.command) >= 2:
|
||||||
title = "MissKaty Paste"
|
title = "MissKaty Paste"
|
||||||
data = message.text.split(None, 1)[1]
|
data = message.text.split(None, 1)[1]
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,7 @@ async def lk21_s(client, message):
|
||||||
keyboard.row(
|
keyboard.row(
|
||||||
InlineButton("❌ Close", f"close#{message.from_user.id}")
|
InlineButton("❌ Close", f"close#{message.from_user.id}")
|
||||||
)
|
)
|
||||||
await editPesan(pesan, lkres, reply_markup=keyboard)
|
await editPesan(pesan, lkres, disable_web_page_preview=True, reply_markup=keyboard)
|
||||||
|
|
||||||
# Pahe CMD
|
# Pahe CMD
|
||||||
@app.on_message(filters.command(['pahe'], COMMAND_HANDLER))
|
@app.on_message(filters.command(['pahe'], COMMAND_HANDLER))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue