format
All checks were successful
black-action / runner / black formatter (push) Successful in 6s

This commit is contained in:
0xMRTT 2023-06-10 22:14:55 +02:00
parent 421acb876c
commit 54ef8641fc
Signed by: 0xMRTT
GPG Key ID: 910B287304120902

View File

@ -33,6 +33,7 @@ from enum import Enum
import uuid import uuid
import subprocess import subprocess
class Style(Enum): class Style(Enum):
""" """
Enumeration class for different styles. Each style has three attributes: Enumeration class for different styles. Each style has three attributes:
@ -730,7 +731,7 @@ def run():
break break
else: else:
return return
try: try:
prompt = " ".join(arg for arg in match.args()) prompt = " ".join(arg for arg in match.args())
response = "".join(Completion.create(prompt)) response = "".join(Completion.create(prompt))
@ -776,7 +777,9 @@ def run():
else: else:
prompt += arg + " " prompt += arg + " "
async def generate_image(image_prompt, style_value, ratio_value, negative): async def generate_image(
image_prompt, style_value, ratio_value, negative
):
imagine = AsyncImagine() imagine = AsyncImagine()
filename = str(uuid.uuid4()) + ".png" filename = str(uuid.uuid4()) + ".png"
try: try:
@ -863,9 +866,10 @@ Help Message:
try: try:
bot.run() bot.run()
except Exception as e: except Exception as e:
subprocess.run(["systemctl", "restart", "--user", SYSTEMD_SERVICE_NAME]) subprocess.run(["systemctl", "restart", "--user", SYSTEMD_SERVICE_NAME])
print("Restarting bot due to {e}") print("Restarting bot due to {e}")
return 1 return 1
if __name__ == "__main__": if __name__ == "__main__":
sys.exit(run()) sys.exit(run())