Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Changes #358

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ tgcrypto
ujson
urlextract
validators
vcsi
vcsi==7.0.15
wand
wget

Expand Down
26 changes: 20 additions & 6 deletions userbot/plugins/sysdetails.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import platform
import sys
import re
from datetime import datetime

import psutil
Expand Down Expand Up @@ -99,20 +100,33 @@ async def cpu(event):


@catub.cat_cmd(
pattern="sysd$",
pattern="(sysd|neofetch)$",
command=("sysd", plugin_category),
info={
"header": "Shows system information using neofetch",
"usage": "{tr}cpu",
"usage": "{tr}sysd",
},
)
async def sysdetails(sysd):
"Shows system information using neofetch"
catevent = await edit_or_reply(sysd, "`Fetching system information.`")
cmd = "git clone https://github.com/dylanaraps/neofetch.git"
await _catutils.runcmd(cmd)
neo = "neofetch/neofetch --off --color_blocks off --bold off --cpu_temp C \
--cpu_speed on --cpu_cores physical --kernel_shorthand off --stdout"
neo = "neofetch/neofetch --color_blocks off --bold off --cpu_temp C --cpu_speed on --cpu_cores physical --kernel_shorthand off"
if sysd.pattern_match.group(1) == 'sysd':
neo = neo+" --off"
a, b, c, d = await _catutils.runcmd(neo)
result = str(a) + str(b)
await edit_or_reply(catevent, f"**Neofetch Result:** `{result}`")
ressult = str(a) + str(b)
result = re.sub('\x1B\[[0-9;\?]*[a-zA-Z]', '', ressult)
await edit_or_reply(catevent, f"**Neofetch Result:**\n```{result}```")

@catub.cat_cmd(
pattern='neofetch',
command=('neofetch', plugin_category),
info={
"header":"Shows system info using neoefetch with logo",
"usage":"{tr}neofetch"
}
)
async def neofetch_help(neo):
"Shows System info using neofetch with logo"