Compare commits

..

No commits in common. "932d24d6a41976fff3e8c6f5548c3ba4bfbc27bb" and "0936ce6937e6cda96da6b97a462f76a279bd603b" have entirely different histories.

2 changed files with 12 additions and 13 deletions

View file

@ -68,14 +68,9 @@ async function updateNowPlaying() {
} else if (playing.startsWith("Coming up")) {
title = playing;
} else {
const metadataLine = playing.match(
const [_, current, peakDay, peakMonth, dj, metadata] = playing.match(
/\[(\d+)\/(\d+)\/(\d+)\] \((.+?)\): (.+)/
);
const current = metadataLine?.[1] ?? "??";
const peakDay = metadataLine?.[2] ?? "??";
const peakMonth = metadataLine?.[3] ?? "??";
const dj = metadataLine?.[4] ?? "unknown";
const metadata = metadataLine?.[5] ?? "unknown";
if (
metadata == "https://archives.anonradio.net" ||

View file

@ -36,8 +36,6 @@ async function processFile(link) {
? ""
: fileName.substring(fileName.lastIndexOf(".") + 1);
if (fileType == "md") return "";
const lineStr = link.match(/#L\d+(-L?\d+)?/)?.[0];
let startLine, endLine;
let entireFile = false;
@ -62,15 +60,21 @@ async function processFile(link) {
? "Line " + startLine
: "Lines " + startLine + "-" + endLine;
if (entireFile && lines.length > 20) return "";
const targetLines = (
entireFile ? lines : lines.slice(startLine - 1, endLine)
entireFile
? lines.length > 30
? lines.slice(0, 30)
: lines
: lines.slice(startLine - 1, endLine)
).join("\n");
return `**${fileName}: **${whichLines}\n\`\`\`${fileType}\n${unindent(
targetLines
)}\n\`\`\``;
)}${
entireFile && lines.length > 30
? `\n... (${lines.length - 30} lines left)`
: ""
}\n\`\`\``;
}
events.add("messageCreate", "codePreviews", async function (msg) {
@ -164,7 +168,7 @@ events.add(
const ref = await channel.getMessage(msg.messageReference.messageID);
if (!ref) return;
if (
ref.author.id != reactor.id &&
ref.author.id != reactor.id ||
!channel.permissionsOf(reactor.id).has("manageMessages")
)
return;