Skip to content

Commit

Permalink
pylint: auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xditya committed Jan 11, 2021
1 parent 87208b6 commit 56c4d84
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions telebot/plugins/rextester.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
# by @its_xditya

from rextester_py import rexec

from . import CMD_HELP


@telebot.on(admin_cmd(pattern="rex"))
async def _(event):
if event.fwd_from:
Expand All @@ -28,8 +30,10 @@ async def _(event):
try:
lang = evtxt.split("//", maxsplit=1)[0]
cmd = evtxt.split("//", maxsplit=1)[1]
except:
return await event.edit(f"Syntax - \n`{Var.CMD_HNDLR}rex language//code`\nLanguages can be found [here](https://github.com/nitanmarcel/rextester_py#languages).")
except BaseException:
return await event.edit(
f"Syntax - \n`{Var.CMD_HNDLR}rex language//code`\nLanguages can be found [here](https://github.com/nitanmarcel/rextester_py#languages)."
)

try:
res = rexec(lang, cmd, None).results
Expand All @@ -38,7 +42,9 @@ async def _(event):
# statt = rexec(lang, cmd, None).stats
except Exception as e:
if str(e) == "Unknown language":
return await event.edit("**ERROR**:\n`Unknown Language!!\nCheck available languages `[here](https://github.com/nitanmarcel/rextester_py#languages)")
return await event.edit(
"**ERROR**:\n`Unknown Language!!\nCheck available languages `[here](https://github.com/nitanmarcel/rextester_py#languages)"
)
return await event.edit(f"**ERROR:**\n`{str(e)}`")
out = f"**- Rextester**\n\n**Language:** `{lang}`\n**Code:** `{cmd}`\n\n**Output:** `{res}`\n\n"
if err is not None:
Expand All @@ -50,9 +56,10 @@ async def _(event):

await event.edit(out)


CMD_HELP.update(
{
"rextester": ".rex <language>//<codes>\
\nUse - Run codes of any language inside telegram. Available languages can be found [here](https://github.com/nitanmarcel/rextester_py#languages)."
}
)
)

0 comments on commit 56c4d84

Please sign in to comment.