Compare commits

..

No commits in common. "8c0d429920970a1abac9451078a7ab87242d6f77" and "04b9b0ed8d0425e89d366e920d191bd17ff404f0" have entirely different histories.

View File

@ -17,7 +17,7 @@ except FileNotFoundError:
intents = discord.Intents.default() intents = discord.Intents.default()
intents.message_content = True intents.message_content = True
api = diffuseapi.DiffuseAPI("https://art.jurydoak.com", ["Bot"], True, 28) api = diffuseapi.DiffuseAPI("https://art.jurydoak.com", ["Bot"], False, 28)
# client = discord.Client(intents=intents) # client = discord.Client(intents=intents)
@ -70,11 +70,7 @@ bot = commands.Bot(intents=intents, command_prefix="!", activity=activity, help_
async def prompt(ctx, *args): async def prompt(ctx, *args):
'''Generate an image with the provided prompt''' '''Generate an image with the provided prompt'''
prompt = " ".join(args) prompt = " ".join(args)
user_roles = [role.name for role in ctx.message.author.roles] await ctx.reply("Generating your image boo")
async with ctx.typing():
if "Bot Ban" not in user_roles:
# await ctx.reply("Generating your image boo")
image_data = await api.generate_image(prompt) image_data = await api.generate_image(prompt)
view = Confirm() view = Confirm()
if image_data is None: if image_data is None:
@ -91,8 +87,6 @@ async def prompt(ctx, *args):
print(h.digest()) print(h.digest())
data = io.BytesIO(decoded_image) data = io.BytesIO(decoded_image)
await ctx.reply("", file=discord.File(data, "_".join(args) + ".png"), view=view) await ctx.reply("", file=discord.File(data, "_".join(args) + ".png"), view=view)
else:
await ctx.reply("NO!")
@bot.command() @bot.command()
@ -121,7 +115,7 @@ async def steps(ctx, arg):
return return
# global num_steps # global num_steps
api.num_steps = arg api.set_steps(arg)
await ctx.reply(f"I have updated the steps to {api.num_steps} for you my master.") await ctx.reply(f"I have updated the steps to {api.num_steps} for you my master.")
@ -132,7 +126,7 @@ async def settings(ctx):
settings = f""" settings = f"""
``` ```
seed: {api.seed} seed: {api.seed}
steps: {api.num_steps} steps: {api.steps}
``` ```
""" """
await ctx.message.channel.send(settings) await ctx.message.channel.send(settings)