mirror of
https://github.com/anonymousx97/social-dl.git
synced 2025-02-20 11:13:19 +08:00
What's New: - Sort Plugins into their respective folders. - download, upload, rename commands. - Help Docstrings. - Proper Logging. - rename .exec cmd to .py
15 lines
418 B
Python
15 lines
418 B
Python
import aiofiles
|
|
|
|
from app import BOT, bot
|
|
from app.core import Message
|
|
|
|
|
|
@bot.add_cmd(cmd="logs")
|
|
async def read_logs(bot: BOT, message: Message):
|
|
async with aiofiles.open("logs/app_logs.txt", "r") as aio_file:
|
|
text = await aio_file.read()
|
|
if len(text) < 4050:
|
|
await message.reply(f"<pre language=bash>{text}</pre>")
|
|
else:
|
|
await message.reply_document(document="logs/app_logs.txt")
|