enable pr0n
This commit is contained in:
parent
4d66dffe5b
commit
90663d9182
44
weeeabot.py
44
weeeabot.py
@ -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"], False, 28)
|
api = diffuseapi.DiffuseAPI("https://art.jurydoak.com", ["Bot"], True, 28)
|
||||||
|
|
||||||
# client = discord.Client(intents=intents)
|
# client = discord.Client(intents=intents)
|
||||||
|
|
||||||
@ -70,23 +70,29 @@ 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)
|
||||||
await ctx.reply("Generating your image boo")
|
user_roles = [role.name for role in ctx.message.author.roles]
|
||||||
image_data = await api.generate_image(prompt)
|
|
||||||
view = Confirm()
|
|
||||||
if image_data is None:
|
|
||||||
await ctx.reply("Something went wrong, please report this to the admin so it can be ignored")
|
|
||||||
return
|
|
||||||
decoded_image = b64decode(image_data)
|
|
||||||
h = hashlib.md5()
|
|
||||||
h.update(decoded_image)
|
|
||||||
digest = h.digest()
|
|
||||||
|
|
||||||
if digest == b'i\xac`\xde\xbak\xba\xab{2Z\xcc\tK\xc2~':
|
async with ctx.typing():
|
||||||
await ctx.reply("Were no stranger to lewds, but you know the rules, and so do I", file=discord.File("images/404.jpg", "404.jpg"))
|
if "Bot Ban" not in user_roles:
|
||||||
return
|
# await ctx.reply("Generating your image boo")
|
||||||
print(h.digest())
|
image_data = await api.generate_image(prompt)
|
||||||
data = io.BytesIO(decoded_image)
|
view = Confirm()
|
||||||
await ctx.reply("", file=discord.File(data, "_".join(args) + ".png"), view=view)
|
if image_data is None:
|
||||||
|
await ctx.reply("Something went wrong, please report this to the admin so it can be ignored")
|
||||||
|
return
|
||||||
|
decoded_image = b64decode(image_data)
|
||||||
|
h = hashlib.md5()
|
||||||
|
h.update(decoded_image)
|
||||||
|
digest = h.digest()
|
||||||
|
|
||||||
|
if digest == b'i\xac`\xde\xbak\xba\xab{2Z\xcc\tK\xc2~':
|
||||||
|
await ctx.reply("Were no stranger to lewds, but you know the rules, and so do I", file=discord.File("images/404.jpg", "404.jpg"))
|
||||||
|
return
|
||||||
|
print(h.digest())
|
||||||
|
data = io.BytesIO(decoded_image)
|
||||||
|
await ctx.reply("", file=discord.File(data, "_".join(args) + ".png"), view=view)
|
||||||
|
else:
|
||||||
|
await ctx.reply("NO!")
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
@ -115,7 +121,7 @@ async def steps(ctx, arg):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# global num_steps
|
# global num_steps
|
||||||
api.set_steps(arg)
|
api.num_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.")
|
||||||
|
|
||||||
@ -126,7 +132,7 @@ async def settings(ctx):
|
|||||||
settings = f"""
|
settings = f"""
|
||||||
```
|
```
|
||||||
seed: {api.seed}
|
seed: {api.seed}
|
||||||
steps: {api.steps}
|
steps: {api.num_steps}
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
await ctx.message.channel.send(settings)
|
await ctx.message.channel.send(settings)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user