Closed FoxxMD closed 4 months ago
It's a really nice PR! Copied it to my repo, thank you!
@FoxxMD There's a PR about Live preview Can you help with Live preview too?
Because if it will be merged - we will need to anyhow hide it.
I try but something wrong here
with contextlib.ExitStack() as stack:
buffer = stack.enter_context(io.BytesIO())
image.save(buffer, 'PNG')
buffer.seek(0)
file = discord.File(fp=buffer, filename=f'{queue_object.seed}.png')
How to add your part right way?
if queue_object.spoiler:
filename=f'SPOILER_{queue_object.seed}.png'
I tried this way
with contextlib.ExitStack() as stack:
buffer = stack.enter_context(io.BytesIO())
image.save(buffer, 'PNG')
buffer.seek(0)
filename=f'{queue_object.seed}.png'
if queue_object.spoiler:
filename=f'SPOILER_{queue_object.seed}.png'
file = discord.File(fp=buffer, filename)
But it gives me SyntaxError: positional argument follows keyword argument
Upd. Solved this way:
with contextlib.ExitStack() as stack:
buffer = stack.enter_context(io.BytesIO())
image.save(buffer, 'PNG')
buffer.seek(0)
filename=f'{queue_object.seed}.png'
if queue_object.spoiler:
filename=f'SPOILER_{queue_object.seed}.png'
fp=buffer
file = discord.File(fp, filename)
Working like a charm!
Heya, looks nice. Thanks for the PR 👍
I wasn't originally planning to do this but a user in my server forced my hand after generating some truly heinous images. :smiling_face_with_tear:
Closes #168
In
/settings
it shows formatted role name when presentCan use
remove_spoiler_role
boolean in settings to entirely remove role in which case it displaysspoiler_role - None
The
spoiler
option in/settings
is a default for the channel that can be overridden using thespoiler
option in the/draw
commandFinally, the entire channel can be forced to use spoilers if the spoiler_role is set to
@everyone