feat: paste overflow via FlaskPaste for long replies

Add Bot.long_reply() that sends lines directly when under threshold,
or creates a FlaskPaste paste with preview + link when over. Refactor
abuseipdb, alert history, crtsh, dork, exploitdb, and subdomain
plugins to use long_reply(). Configurable paste_threshold (default: 4).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user
2026-02-17 22:07:31 +01:00
parent 8cabe0f8e8
commit 1836fa50af
9 changed files with 242 additions and 21 deletions

View File

@@ -158,10 +158,10 @@ async def cmd_exploitdb(bot, message):
if not matches:
await bot.reply(message, f"No exploits matching '{term}'")
return
for entry in matches[:_MAX_RESULTS]:
await bot.reply(message, _format_entry(entry))
lines = [_format_entry(e) for e in matches[:_MAX_RESULTS]]
if len(matches) > _MAX_RESULTS:
await bot.reply(message, f"({len(matches)} total, showing {_MAX_RESULTS})")
lines.append(f"({len(matches)} total, showing {_MAX_RESULTS})")
await bot.long_reply(message, lines, label="exploits")
return
if sub.lower() == "cve":
@@ -177,10 +177,10 @@ async def cmd_exploitdb(bot, message):
if not matches:
await bot.reply(message, f"No exploits for {cve_id}")
return
for entry in matches[:_MAX_RESULTS]:
await bot.reply(message, _format_entry(entry))
lines = [_format_entry(e) for e in matches[:_MAX_RESULTS]]
if len(matches) > _MAX_RESULTS:
await bot.reply(message, f"({len(matches)} total, showing {_MAX_RESULTS})")
lines.append(f"({len(matches)} total, showing {_MAX_RESULTS})")
await bot.long_reply(message, lines, label="exploits")
return
# Direct ID lookup
@@ -209,7 +209,7 @@ async def cmd_exploitdb(bot, message):
if not matches:
await bot.reply(message, f"No exploits matching '{term}'")
return
for entry in matches[:_MAX_RESULTS]:
await bot.reply(message, _format_entry(entry))
lines = [_format_entry(e) for e in matches[:_MAX_RESULTS]]
if len(matches) > _MAX_RESULTS:
await bot.reply(message, f"({len(matches)} total, showing {_MAX_RESULTS})")
lines.append(f"({len(matches)} total, showing {_MAX_RESULTS})")
await bot.long_reply(message, lines, label="exploits")