mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 09:44:50 +00:00
* style: format code with isort, Ruff Formatter and Yapf This commit fixes the style issues introduced inf9f107eaccording to the output from isort, Ruff Formatter and Yapf. Details: None * refactor: autofix issues in 2 files Resolved issues in the following files with DeepSource Autofix: 1. misskaty/plugins/download_upload.py 2. misskaty/plugins/nightmodev2.py * style: format code with isort, Ruff Formatter and Yapf This commit fixes the style issues introduced in1bc1345according to the output from isort, Ruff Formatter and Yapf. Details: https://github.com/yasirarism/MissKatyPyro/pull/300 * refactor: autofix issues in 2 files Resolved issues in the following files with DeepSource Autofix: 1. misskaty/plugins/dev.py 2. misskaty/plugins/misc_tools.py * style: format code with isort, Ruff Formatter and Yapf This commit fixes the style issues introduced in58d2f1aaccording to the output from isort, Ruff Formatter and Yapf. Details: https://github.com/yasirarism/MissKatyPyro/pull/300 --------- Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com> Co-authored-by: Yasir Aris M <git@yasirdev.my.id>
46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
"""
|
|
* @author yasir <yasiramunandar@gmail.com>
|
|
* @date 2022-12-01 09:12:27
|
|
* @projectName MissKatyPyro
|
|
* Copyright @YasirPedia All rights reserved
|
|
"""
|
|
|
|
import os
|
|
|
|
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
|
|
|
|
from misskaty import app
|
|
|
|
|
|
# View Structure Telegram Message As JSON
|
|
@app.on_cmd("json")
|
|
async def jsonify(_, message: Message):
|
|
the_real_message = None
|
|
reply_to_id = None
|
|
|
|
the_real_message = message.reply_to_message or message
|
|
try:
|
|
await message.reply_text(
|
|
f"<code>{the_real_message}</code>",
|
|
reply_markup=InlineKeyboardMarkup(
|
|
[
|
|
[
|
|
InlineKeyboardButton(
|
|
text="❌ Close",
|
|
callback_data=f"close#{message.from_user.id if message.from_user else 2024984460}",
|
|
)
|
|
]
|
|
]
|
|
),
|
|
)
|
|
except Exception as e:
|
|
with open("json.txt", "w+", encoding="utf8") as out_file:
|
|
out_file.write(str(the_real_message))
|
|
await message.reply_document(
|
|
document="json.txt",
|
|
caption=f"<code>{str(e)}</code>",
|
|
disable_notification=True,
|
|
reply_to_message_id=reply_to_id,
|
|
thumb="assets/thumb.jpg",
|
|
)
|
|
os.remove("json.txt")
|