mirror of
https://github.com/Nick80835/microbot
synced 2025-08-22 01:58:17 +00:00
ignore venv/directory files, better check for neofetch
This commit is contained in:
parent
a27fe7ea70
commit
621652d9a4
4
.gitignore
vendored
4
.gitignore
vendored
@ -4,4 +4,6 @@ settings.ini
|
||||
*.session-journal
|
||||
*.sqlite*
|
||||
testing.py
|
||||
cache
|
||||
cache
|
||||
.venv
|
||||
.directory
|
@ -5,6 +5,7 @@ import os
|
||||
import sys
|
||||
from datetime import timedelta
|
||||
from platform import python_version
|
||||
from shutil import which
|
||||
from time import time
|
||||
from traceback import print_exc
|
||||
|
||||
@ -119,20 +120,20 @@ async def update_bot(event):
|
||||
|
||||
@ldr.add("sysd", sudo=True, hide_help=True)
|
||||
async def sysd(event):
|
||||
try:
|
||||
neo = "neofetch --stdout"
|
||||
|
||||
fetch = await asyncio.create_subprocess_shell(
|
||||
neo,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
)
|
||||
|
||||
stdout, stderr = await fetch.communicate()
|
||||
|
||||
await event.reply(f"`{stdout.decode().strip()}{stderr.decode().strip()}`")
|
||||
except FileNotFoundError:
|
||||
if which("neofetch") is not None:
|
||||
command = "neofetch --stdout"
|
||||
else:
|
||||
await event.reply("Neofetch not found!")
|
||||
return
|
||||
|
||||
fetch = await asyncio.create_subprocess_shell(
|
||||
command,
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.PIPE,
|
||||
)
|
||||
|
||||
stdout, stderr = await fetch.communicate()
|
||||
await event.reply(f"```{stdout.decode().strip()}{stderr.decode().strip()}```")
|
||||
|
||||
|
||||
@ldr.add("alive", sudo=True, hide_help=True)
|
||||
|
Loading…
x
Reference in New Issue
Block a user