mirror of
https://github.com/SethCohen/github-releases-to-discord
synced 2026-09-14 20:13:23 +00:00
feat: updated description format
This commit is contained in:
@@ -27,11 +27,24 @@ async function run () {
|
|||||||
|
|
||||||
const content = await getContext()
|
const content = await getContext()
|
||||||
|
|
||||||
|
let description = '';
|
||||||
|
for (const line of content.body) {
|
||||||
|
if (line.startsWith('## ')) {
|
||||||
|
description += `**${line.slice(3)}**\n`;
|
||||||
|
}
|
||||||
|
else if (line.startsWith('### ')) {
|
||||||
|
description += `**__${line.slice(4)}__**\n`;
|
||||||
|
}
|
||||||
|
else if (line.startsWith('* ')) {
|
||||||
|
description += `- ${line.slice(2)}\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const embedMsg = {
|
const embedMsg = {
|
||||||
title: `Release ${content.version}`,
|
title: `Release ${content.version}`,
|
||||||
url: content.html_url,
|
url: content.html_url,
|
||||||
color: colour,
|
color: colour,
|
||||||
description: content.body,
|
description: description,
|
||||||
}
|
}
|
||||||
|
|
||||||
const body = { username: username, avatar_url: avatarUrl, embeds: [embedMsg], }
|
const body = { username: username, avatar_url: avatarUrl, embeds: [embedMsg], }
|
||||||
|
|||||||
Reference in New Issue
Block a user