From 60c7a4f335d1ad482d4e2b8dd503be9e5ba6bbcf Mon Sep 17 00:00:00 2001 From: phixxy Date: Wed, 17 Jan 2024 23:54:47 -0800 Subject: [PATCH] changed logging for stable diffusion --- plugins/stable_diffusion.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/stable_diffusion.py b/plugins/stable_diffusion.py index 102af99..1d895d9 100644 --- a/plugins/stable_diffusion.py +++ b/plugins/stable_diffusion.py @@ -5,6 +5,7 @@ import aiohttp import os import time import random +import json from PIL import Image, PngImagePlugin from discord.ext import commands @@ -294,14 +295,15 @@ async def imagine(ctx): with open(my_filename, "rb") as fh: f = discord.File(fh, filename=my_filename) - log_data = {'Author': ctx.author.name, 'Prompt': prompt, "Filename":my_filename} + + log_data = f'Author: {ctx.author.name}, Prompt: {prompt}, Filename:{my_filename}\n' with open("databases/stable_diffusion.log", 'a') as log_file: - log_file.writelines(list(log_data)) + log_file.writelines(log_data) + await ctx.send(f'Generated by: {ctx.author.name}\nPrompt: {prompt}', file=f) await http_session.close() - @commands.command( description="Describe", help="Get better understanding of what the bot \"sees\" when you post an image! (Runs it through CLIP) Usage !describe (image link)",