Update sweebot.py

This commit is contained in:
Nova Cat 2025-03-11 15:52:53 -07:00
parent 45ace462c3
commit 9e2518b0ea

View file

@ -668,14 +668,14 @@ while True:
elif command[0] == "$dopull":
irc.send_irc(channel, nick + ":[...] Please wait, pulling docker image...")
image = dock.images.pull('alpine')
image = dock.images.pull('alpine/edge')
irc.send_irc(channel, nick + ":[OK] Pulled docker image, running command now.")
elif command[0] == "$doshell":
if len(command) > 1:
try:
print("Running container")
if cntr == None:
cntr = dock.containers.run('alpine', "/bin/ash", detach=True, tty=True)
cntr = dock.containers.run('alpine/edge', "/bin/ash", detach=True, tty=True)
print("Executing...")
_, stream = cntr.exec_run(cmd=" ".join(command[1:]))
multiline(stream, channel)