Skip to content

Commit 840197f

Browse files
Refactor: Simplify Discord release message
This commit updates the `post-discord-release.js` script to simplify the messages sent to Discord. - Pull request numbers are now removed from commit messages. - Commit hashes are no longer included in the Discord message. - The download link for the release is now enclosed in angle brackets for proper Discord formatting. Signed-off-by: CreativeCodeCat <wayne6324@gmail.com>
1 parent d9d3cf2 commit 840197f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

post-discord-release.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function cleanMessage(message) {
4141
}
4242

4343
function linkPR(message) {
44-
return message.replace(/\(#(\d+)\)/g, (_, num) => `([#${num}](${REPO_URL}/pull/${num}))`);
44+
return message.replace(/\(#(\d+)\)/g, (_, num) => ``);
4545
}
4646

4747
function classifyCommit(message) {
@@ -76,7 +76,7 @@ const commits = rawCommits
7676
const groups = {};
7777
for (const c of commits) {
7878
groups[c.group] = groups[c.group] || [];
79-
groups[c.group].push(`* ${c.message} ([${c.hash}](${REPO_URL}/commit/${c.hash}))`);
79+
groups[c.group].push(`* ${c.message}`);
8080
}
8181

8282
// Build plain message
@@ -91,7 +91,7 @@ for (const group of GROUP_ORDER) {
9191
if (!commits.length) discordMessage += "No commits found.";
9292

9393
// Append download link
94-
discordMessage += `\n[Download Multi Launcher](${REPO_URL}/releases/tag/${latestTag})`;
94+
discordMessage += `\n[Download Multi Launcher](<${REPO_URL}/releases/tag/${latestTag}>)`;
9595

9696
// Send to Discord
9797
const payload = JSON.stringify({

0 commit comments

Comments
 (0)