forked from Firepup650/FireBot
Add uptime command (#14)
Because every bot needs an uptime command! Add uptime command077eed6427
Fix stupid mistakea66cfd848a
Make fp happy48a503a392
Reviewed-on: https://git.amcforum.wiki/Firepup650/fire-ircbot/pulls/14 Reviewed-by: Firepup Sixfifty <firepyp650@gmail.com> Co-authored-by: 9pfs <9pfs@amcforum.wiki> Co-committed-by: 9pfs <9pfs@amcforum.wiki>
This commit is contained in:
parent
4b64d8a98b
commit
b6e59588a2
1 changed files with 7 additions and 0 deletions
|
@ -9,6 +9,7 @@ from dotenv import load_dotenv
|
||||||
from pythonlangutil.overload import Overload, signature
|
from pythonlangutil.overload import Overload, signature
|
||||||
from datetime import datetime as dt
|
from datetime import datetime as dt
|
||||||
from logs import log
|
from logs import log
|
||||||
|
from subprocess import run, PIPE
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
||||||
|
@ -360,6 +361,12 @@ def main():
|
||||||
f"{name}: pong",
|
f"{name}: pong",
|
||||||
chan,
|
chan,
|
||||||
)
|
)
|
||||||
|
elif mfind(message, ["uptime"]):
|
||||||
|
uptime = run(["uptime","-p"], stdout=PIPE).stdout.decode().strip()
|
||||||
|
sendmsg(
|
||||||
|
f"Uptime: {uptime}",
|
||||||
|
chan,
|
||||||
|
)
|
||||||
elif mfind(message, ["amIAdmin"]):
|
elif mfind(message, ["amIAdmin"]):
|
||||||
sendmsg(
|
sendmsg(
|
||||||
f"{name.lower()} in {adminnames} == {name.lower() in adminnames}",
|
f"{name.lower()} in {adminnames} == {name.lower() in adminnames}",
|
||||||
|
|
Loading…
Reference in a new issue