feat: applied coderabbit suggestions

This commit is contained in:
Muhamad Aji Wibisono 2025-06-02 21:03:50 +07:00
parent afc1100f6d
commit 42cc1b8fbe
5 changed files with 11 additions and 21 deletions

View file

@ -1026,9 +1026,12 @@ class ConnectorService:
if len(description) == 100:
description += "..."
# For URL, we can use a placeholder or construct a URL to the Discord channel if available
url = ""
if channel_id:
guild_id = metadata.get('guild_id', '')
if guild_id and channel_id:
url = f"https://discord.com/channels/{guild_id}/{channel_id}"
elif channel_id:
# Fallback for DM channels or when guild_id is not available
url = f"https://discord.com/channels/@me/{channel_id}"
source = {