Skip to content

Commit d3d24a8

Browse files
Fix devtorture command display in both Telegram and Discord - show complete output
1 parent bbb9931 commit d3d24a8

2 files changed

Lines changed: 77 additions & 40 deletions

File tree

server/discord-bot.ts

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -447,66 +447,74 @@ function createDiscordClient(botToken: string, clientId: string): Client {
447447
const analysis = await tokenAnalyzer.analyzeToken(tokenAddress);
448448

449449
const embed = new EmbedBuilder()
450-
.setColor(0xff6b2c)
450+
.setColor(hasFlags ? 0xff0000 : 0x00ff00)
451451
.setTitle(`🔥 Dev Torture Report - ${analysis.metadata.symbol}`)
452-
.setDescription(`Contract: \`${tokenAddress.slice(0, 4)}...${tokenAddress.slice(-4)}\``)
452+
.setDescription(`Full token: \`${tokenAddress}\``)
453453
.setTimestamp();
454454

455455
let hasFlags = false;
456456

457457
// Mint authority
458+
let mintValue = '';
458459
if (analysis.mintAuthority.hasAuthority && !analysis.mintAuthority.isRevoked) {
459-
embed.addFields({
460-
name: '❌ Mint Authority Active',
461-
value: `Dev can mint unlimited tokens!\nAuthority: \`${formatAddress(analysis.mintAuthority.authorityAddress || 'Unknown')}\``
462-
});
460+
mintValue = `❌ **ACTIVE**\nDev can mint unlimited tokens!`;
461+
if (analysis.mintAuthority.authorityAddress) {
462+
mintValue += `\nAuthority: \`${formatAddress(analysis.mintAuthority.authorityAddress)}\``;
463+
}
463464
hasFlags = true;
464465
} else {
465-
embed.addFields({
466-
name: '✅ Mint Authority',
467-
value: 'Revoked - Dev cannot mint new tokens'
468-
});
466+
mintValue = '✅ **REVOKED**\nDev cannot mint new tokens';
469467
}
468+
embed.addFields({
469+
name: '🪙 Mint Authority',
470+
value: mintValue,
471+
inline: false
472+
});
470473

471474
// Freeze authority
475+
let freezeValue = '';
472476
if (analysis.freezeAuthority.hasAuthority && !analysis.freezeAuthority.isRevoked) {
473-
embed.addFields({
474-
name: '❌ Freeze Authority Active',
475-
value: `Dev can freeze accounts!\nAuthority: \`${formatAddress(analysis.freezeAuthority.authorityAddress || 'Unknown')}\``
476-
});
477+
freezeValue = `❌ **ACTIVE**\nDev can freeze accounts!`;
478+
if (analysis.freezeAuthority.authorityAddress) {
479+
freezeValue += `\nAuthority: \`${formatAddress(analysis.freezeAuthority.authorityAddress)}\``;
480+
}
477481
hasFlags = true;
478482
} else {
479-
embed.addFields({
480-
name: '✅ Freeze Authority',
481-
value: 'Revoked - Dev cannot freeze accounts'
482-
});
483+
freezeValue = '✅ **REVOKED**\nDev cannot freeze accounts';
483484
}
485+
embed.addFields({
486+
name: '🧊 Freeze Authority',
487+
value: freezeValue,
488+
inline: false
489+
});
484490

491+
// Token age
485492
if (analysis.creationDate) {
486493
const age = Math.floor((Date.now() - analysis.creationDate) / (1000 * 60 * 60 * 24));
487-
let ageText = `Token Age: ${age} days`;
494+
let ageText = `${age} days old`;
488495
if (age < 7) {
489496
ageText += '\n⚠️ Very new token - high risk!';
490497
hasFlags = true;
498+
} else if (age < 30) {
499+
ageText += '\n⚠️ New token - exercise caution';
500+
} else {
501+
ageText += '\n✅ Established token';
491502
}
492503
embed.addFields({
493-
name: '📅 Age',
494-
value: ageText
504+
name: '📅 Token Age',
505+
value: ageText,
506+
inline: false
495507
});
496508
}
497509

498510
// Add overall verdict
499-
if (!hasFlags) {
500-
embed.addFields({
501-
name: '🎉 Overall',
502-
value: '✅ Token passes basic dev torture checks!'
503-
});
504-
} else {
505-
embed.addFields({
506-
name: '⚠️ Overall',
507-
value: '🚨 Token has concerning dev permissions!'
508-
});
509-
}
511+
embed.addFields({
512+
name: '━━━━━━━━━━━━━━━━',
513+
value: !hasFlags
514+
? '🎉 **VERDICT: SAFE**\n✅ Token passes dev torture checks!'
515+
: '⚠️ **VERDICT: CONCERNING**\n🚨 Token has concerning dev permissions!',
516+
inline: false
517+
});
510518

511519
await interaction.editReply({ embeds: [embed] });
512520
} catch (error: any) {

server/telegram-bot.ts

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -319,33 +319,62 @@ function createTelegramBot(botToken: string): Telegraf {
319319
const analysis = await tokenAnalyzer.analyzeToken(tokenAddress);
320320

321321
let message = `🔥 **DEV TORTURE REPORT - ${analysis.metadata.symbol}**\n\n`;
322-
message += `Contract: \`${formatAddress(tokenAddress)}\`\n\n`;
322+
message += `Token: \`${tokenAddress}\`\n\n`;
323323

324+
let hasFlags = false;
325+
326+
// Mint Authority Check
327+
message += `🪙 **MINT AUTHORITY**\n`;
324328
if (analysis.mintAuthority.hasAuthority && !analysis.mintAuthority.isRevoked) {
325-
message += `❌ **MINT AUTHORITY ACTIVE**\n`;
326-
message += `Dev can mint unlimited tokens!\n`;
329+
message += `❌ ACTIVE - Dev can mint unlimited tokens!\n`;
327330
if (analysis.mintAuthority.authorityAddress) {
328-
message += `Authority: \`${formatAddress(analysis.mintAuthority.authorityAddress)}\`\n\n`;
331+
message += `Authority: \`${formatAddress(analysis.mintAuthority.authorityAddress)}\`\n`;
329332
}
333+
hasFlags = true;
334+
} else {
335+
message += `✅ REVOKED - Dev cannot mint new tokens\n`;
330336
}
337+
message += `\n`;
331338

339+
// Freeze Authority Check
340+
message += `🧊 **FREEZE AUTHORITY**\n`;
332341
if (analysis.freezeAuthority.hasAuthority && !analysis.freezeAuthority.isRevoked) {
333-
message += `❌ **FREEZE AUTHORITY ACTIVE**\n`;
334-
message += `Dev can freeze accounts!\n`;
342+
message += `❌ ACTIVE - Dev can freeze accounts!\n`;
335343
if (analysis.freezeAuthority.authorityAddress) {
336-
message += `Authority: \`${formatAddress(analysis.freezeAuthority.authorityAddress)}\`\n\n`;
344+
message += `Authority: \`${formatAddress(analysis.freezeAuthority.authorityAddress)}\`\n`;
337345
}
346+
hasFlags = true;
347+
} else {
348+
message += `✅ REVOKED - Dev cannot freeze accounts\n`;
338349
}
350+
message += `\n`;
339351

352+
// Token Age Check
340353
if (analysis.creationDate) {
341354
const age = Math.floor((Date.now() - analysis.creationDate) / (1000 * 60 * 60 * 24));
342-
message += `📅 **AGE**: ${age} days\n`;
355+
message += `📅 **TOKEN AGE**\n`;
356+
message += `${age} days old\n`;
343357
if (age < 7) {
344358
message += `⚠️ Very new token - high risk!\n`;
359+
hasFlags = true;
360+
} else if (age < 30) {
361+
message += `⚠️ New token - exercise caution\n`;
362+
} else {
363+
message += `✅ Established token\n`;
345364
}
346365
message += `\n`;
347366
}
348367

368+
// Overall Verdict
369+
message += `━━━━━━━━━━━━━━━━\n`;
370+
if (!hasFlags) {
371+
message += `🎉 **VERDICT: SAFE**\n`;
372+
message += `✅ Token passes dev torture checks!`;
373+
} else {
374+
message += `⚠️ **VERDICT: CONCERNING**\n`;
375+
message += `🚨 Token has dev permissions!`;
376+
}
377+
349378
await ctx.reply(message, { parse_mode: 'Markdown' });
350379
} catch (error) {
351380
console.error('Telegram bot devtorture error:', error);

0 commit comments

Comments
 (0)