mirror of
https://github.com/RGBCube/VReplBot
synced 2025-07-25 23:47:45 +00:00
Fix edge case
This commit is contained in:
parent
ce76c1b251
commit
06f3829207
1 changed files with 2 additions and 4 deletions
|
@ -49,15 +49,13 @@ class Playground(
|
|||
content = await get_message_content(ctx.channel, reply)
|
||||
code = codeblock_converter(content)
|
||||
|
||||
print(code.content)
|
||||
async with await self.bot.session.post(
|
||||
f"https://play.vlang.io/{type}",
|
||||
data = { "code": code.content },
|
||||
) as response:
|
||||
print(await response.text())
|
||||
text = sanitize_str_for_codeblock(await response.text())
|
||||
|
||||
if len(text) + 6 > 2000:
|
||||
if len(text) + 7 > 2000:
|
||||
await ctx.reply(
|
||||
"The output was too long to be sent as a message. Here is a file instead:",
|
||||
file = File(BytesIO(text.encode()), filename = "output.txt")
|
||||
|
@ -65,7 +63,7 @@ class Playground(
|
|||
return
|
||||
|
||||
await ctx.reply(
|
||||
"```" + text + "```"
|
||||
"```\n" + text + "```"
|
||||
)
|
||||
|
||||
@command(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue