mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-20 02:26:32 +01:00
Detect language easier
This commit is contained in:
parent
798a63f7d9
commit
b7fe887736
1 changed files with 2 additions and 1 deletions
|
@ -94,6 +94,7 @@ class Events(commands.Cog):
|
||||||
)
|
)
|
||||||
if _re:
|
if _re:
|
||||||
branch, path = _re.group("path").split("/", 1)
|
branch, path = _re.group("path").split("/", 1)
|
||||||
|
_p = Path(path).suffix
|
||||||
url = RAW_URL.format(
|
url = RAW_URL.format(
|
||||||
repo=_re.group("repo"),
|
repo=_re.group("repo"),
|
||||||
branch=branch,
|
branch=branch,
|
||||||
|
@ -112,7 +113,7 @@ class Events(commands.Cog):
|
||||||
end_line = int(_re.group("end_line")) if _re.group("end_line") else start_line + 1
|
end_line = int(_re.group("end_line")) if _re.group("end_line") else start_line + 1
|
||||||
lines = lines[start_line:end_line]
|
lines = lines[start_line:end_line]
|
||||||
|
|
||||||
paginator = commands.Paginator(prefix="```py", suffix="```", max_size=1000)
|
paginator = commands.Paginator(prefix="```" + _p[1:], suffix="```", max_size=1000)
|
||||||
for line in lines:
|
for line in lines:
|
||||||
paginator.add_line(line)
|
paginator.add_line(line)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue