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)",