summary refs log tree commit diff
diff options
context:
space:
mode:
authorCyber <cyber.hf18@gmail.com>2025-12-19 07:59:11 +0100
committerGitHub <noreply@github.com>2025-12-19 07:59:11 +0100
commitbaef604fc2782df5eabdf588ee6b85cb01611ae3 (patch)
tree1ea9c6938a2bcaf4f65fa8faa95dc899d7104637
parentMerge pull request #1445 from CyberL1/refactor/gh-embed-length (diff)
parentrefactor: adjust numbers for length limits (diff)
downloadserver-ts-baef604fc2782df5eabdf588ee6b85cb01611ae3.tar.xz
Merge pull request #1446 from CyberL1/refactor/gh-embed-length
-rw-r--r--src/api/routes/webhooks/#webhook_id/#token/github.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/routes/webhooks/#webhook_id/#token/github.ts b/src/api/routes/webhooks/#webhook_id/#token/github.ts

index f3f8235e..71f61917 100644 --- a/src/api/routes/webhooks/#webhook_id/#token/github.ts +++ b/src/api/routes/webhooks/#webhook_id/#token/github.ts
@@ -95,7 +95,7 @@ const parseGitHubWebhook = (req: Request, res: Response, next: NextFunction) => req.body.issue.title.length > 150 ? `${req.body.issue.title.slice(0, 147)}...` : req.body.issue.title }`, url: req.body.comment.html_url, - description: req.body.comment.body.length > 501 ? `${req.body.comment.body.slice(0, 497)}...` : req.body.comment.body, + description: req.body.comment.body.length > 500 ? `${req.body.comment.body.slice(0, 497)}...` : req.body.comment.body, }, ]; break; @@ -119,7 +119,7 @@ const parseGitHubWebhook = (req: Request, res: Response, next: NextFunction) => if (req.body.action === "opened") { discordPayload.embeds[0].color = 15426592; - discordPayload.embeds[0].description = req.body.issue.body.length > 501 ? `${req.body.issue.body.slice(0, 497)}...` : req.body.issue.body; + discordPayload.embeds[0].description = req.body.issue.body.length > 500 ? `${req.body.issue.body.slice(0, 497)}...` : req.body.issue.body; } break; case "member": @@ -252,7 +252,7 @@ const parseGitHubWebhook = (req: Request, res: Response, next: NextFunction) => .slice(0, 5) // Discord only shows 5 first commits .map( (c: { id: string; url: string; message: string; author: { username: string } }) => - `[\`${c.id.slice(0, 7)}\`](${c.url}) ${c.message.split("\n")[0].length > 46 ? `${c.message.slice(0, 47)}...` : c.message.split("\n")[0]} - ${c.author.username}`, + `[\`${c.id.slice(0, 7)}\`](${c.url}) ${c.message.split("\n")[0].length > 49 ? `${c.message.slice(0, 47)}...` : c.message.split("\n")[0]} - ${c.author.username}`, ) .join("\n"), },