1
Fork 0
mirror of https://github.com/RGBCube/VReplBot synced 2025-07-30 01:47:45 +00:00
This commit is contained in:
RGBCube 2023-02-03 21:52:47 +03:00
parent 7a9706ee0d
commit 271706db7e
3 changed files with 21 additions and 17 deletions

View file

@ -53,9 +53,12 @@ class Miscellaneous(
await ctx.reply(
strip(
f"""
__**Bot Info**__
**Python Version:** v{python_version()}
**Uptime:** `{TimeDelta(seconds = int(get_time() - self.bot.ready_timestamp))}`
```
Bot Info
========
Python Version: v{python_version()}
Uptime: {TimeDelta(seconds = int(get_time() - self.bot.ready_timestamp))}
```
"""
)
)

View file

@ -41,21 +41,22 @@ class Playground(
*,
type: Literal["run"] | Literal["run_test"]
) -> None:
if (c_stripped := code.lstrip("https://")).startswith("play.vlang.io/?query="):
query = c_stripped.lstrip("play.vlang.io/?query=").split(" ", 1)[0]
code = await self.get_query_content(query)
if not code:
await ctx.reply("Invalid query.")
return
elif not code:
if not code:
if not (reply := ctx.message.reference):
await ctx.reply("No code provided.")
return
content = await get_message_content(ctx.channel, reply)
code = codeblock_converter(content).content
if (c_stripped := content.lstrip("https://")).startswith("play.vlang.io/?query="):
query = c_stripped.lstrip("play.vlang.io/?query=").split(" ", 1)[0]
code = await self.get_query_content(query)
if not code:
await ctx.reply("Invalid query.")
return
else:
code = codeblock_converter(content).content
async with await self.bot.session.post(
f"https://play.vlang.io/{type}",