From e4b50f175ac307ba222956dddb4d2f343d769e9e Mon Sep 17 00:00:00 2001 From: Luke Robles <98352913+lrobles-iterable@users.noreply.github.com> Date: Wed, 5 Oct 2022 12:05:30 -0700 Subject: [PATCH] Send my requests to my 3080 if the computer is online, otherwise go to ein --- app/cogs/actual_utils.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/cogs/actual_utils.py b/app/cogs/actual_utils.py index 909aa5c7..70accaff 100644 --- a/app/cogs/actual_utils.py +++ b/app/cogs/actual_utils.py @@ -68,15 +68,23 @@ class ActualUtils(commands.Cog): @commands.command(name="sd") async def sd(self, ctx: commands.Context, *, prompt): - # if ctx.message.author.id != 144986109804412928: - # await ctx.send("Sorry, this is a paid dale-bot feature") - # return - + import socket import stable_diffusion + port = "7860" + ip = "192.168.1.80" + + # Send my requests to my gaming computer with the 3080 (if its up) + if ctx.message.author.id == 144986109804412928: + ip = "192.168.1.188" + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + s.settimeout(1) + try: + s.connect((ip, int(port))) + except: + ip = "192.168.1.80" + try: - ip = "192.168.1.80" - port = "7860" file_path = stable_diffusion.generate_image(ip=ip, port=port, prompt=prompt) await ctx.reply( file=discord.File(