Remove text truncation limits from Telegram posts
Posts were being cut to 300 chars (source ingestion) and 150 chars (alert evaluation), losing valuable OSINT context. The sendMessage chunker already handles the 4096-char Telegram API limit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -94,7 +94,7 @@ export async function getChat(chatId) {
|
||||
// Compact a Bot API message for briefing output
|
||||
function compactBotMessage(msg) {
|
||||
return {
|
||||
text: (msg.text || msg.caption || '').slice(0, 300),
|
||||
text: msg.text || msg.caption || '',
|
||||
date: msg.date ? new Date(msg.date * 1000).toISOString() : null,
|
||||
chat: msg.chat?.title || msg.chat?.username || 'unknown',
|
||||
views: msg.views || 0,
|
||||
@@ -171,8 +171,7 @@ function parseWebPreview(html, channelId) {
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'")
|
||||
.replace(/ /g, ' ')
|
||||
.trim()
|
||||
.slice(0, 300);
|
||||
.trim();
|
||||
}
|
||||
|
||||
// Extract view count
|
||||
|
||||
@@ -681,7 +681,7 @@ Respond with ONLY valid JSON:
|
||||
if (osintSignals.length > 0) {
|
||||
sections.push('📡 OSINT SIGNALS:\n' + osintSignals.map(s => {
|
||||
const post = s.item || s;
|
||||
return ` [${post.channel || 'UNKNOWN'}] ${(post.text || s.reason || '').substring(0, 150)}`;
|
||||
return ` [${post.channel || 'UNKNOWN'}] ${post.text || s.reason || ''}`;
|
||||
}).join('\n'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user