codePreviews: fix line number regex
This commit is contained in:
parent
4c681a137e
commit
fa91219714
1 changed files with 2 additions and 2 deletions
|
@ -44,12 +44,12 @@ events.add("messageCreate", "codePreviews", async function (msg) {
|
|||
? ""
|
||||
: fileName.substring(fileName.indexOf(".") + 1);
|
||||
|
||||
const lineStr = link.match(/#L\d+?(-L\d+?)?/)?.[0];
|
||||
const lineStr = link.match(/#L\d+(-L\d+)?/)?.[0];
|
||||
let startLine, endLine;
|
||||
let entireFile = false;
|
||||
|
||||
if (lineStr) {
|
||||
let [start, end] = link.match(/L\d+?/g);
|
||||
let [start, end] = link.match(/L\d+/g);
|
||||
start = parseInt(start.replace("L", ""));
|
||||
if (!end) {
|
||||
startLine = endLine = start;
|
||||
|
|
Loading…
Reference in a new issue