// Evidence Dossier
MankekeDev Discord Bot
A user looks up a domain in Discord and receives a channel summary with an attachment for details. The case study explains what the bot checks, how it handles failures and when it reuses results.
Look up a domain from Discord
The user receives a channel summary and a text attachment for reviewing the details of the lookup.
- Submit the domain through the command.
- Review DNS, registration, HTTP headers and the TLS certificate.
- Open the attachment and check which sources responded.
In the simulated check, a TLS failure left the HTTP result visible. The report flagged the failure and a retry recovered TLS.
- Who it serves
Discord administrators and communities that need public information and security signals within their usual workspace.
- My responsibility
Complete end-to-end development: architecture, commands, events, integrations, persistence, presentation and tests.
- Current status
The author reports deployment and operational use. Local validation passed 37/37 original tests and 10/10 additional checks with simulated Discord and transports.
- What it enables
Look up a domain from Discord, review a summary and open the attachment with details from available sources.
Context
MankekeDev brings defensive lookups and automation into the place where a community communicates: Discord. Its main user needs to interpret public domain information or inspect visible server configuration.
This review focuses on the consolidated domain report. Indicator reputation, moderation and music extend the surface but did not receive the same end-to-end validation.
Problem
Centralizing observations is insufficient if missing data is mistaken for a favorable result. DNS, domain registration, HTTP and TLS provide different observations with independent failures and availability. The design problem is to combine them without hiding their scope.
Community administration adds another requirement: distinguish ordinary lookups from permission-controlled actions and understand what information remains in Discord, in the process or with external services.
My role
I designed and developed the complete Node.js bot: modular structure, slash commands, events, OSINT services, SQLite persistence, reports, permission reviews, anti-raid, phishing, music and tests.
Constraints
Discord has its own permissions, intents and limits. Lookups depend on DNS, connectivity and services with quotas; music adds extractors and audio. The bot requires a continuous process and writable local storage.
Validation excluded credentials, real data and external connections. No Discord session was opened or commands registered. High-impact operational commands remain outside the public sample and require separate review.
Solution
The domain report combines DNS, RDAP, HTTP and TLS in an embed and text output. It lists rejected sources, retains available observations and marks unverified fields. DNS has a limit: lookup errors become empty records; it does not distinguish absent data from resolver failure. Its header score is a program heuristic, not a comprehensive security assessment.
Other modules query Shodan, AbuseIPDB, VirusTotal and urlscan; inspect server configuration, observe mass joins and phishing signals, or manage music and queues. Anti-raid sends alerts: automatic quarantine was neither verified nor implemented in the reviewed join flow.
Architecture
Node.js 20+ and Discord.js v14 using CommonJS. Loaders discover commands and events; the router selects modules, applies OSINT quotas and handles errors. Separate services query and normalize data; utilities prepare embeds and reports. Discord Player supports music.
SQLite through better-sqlite3 uses WAL with two tables: OSINT cache and recent member joins. Winston writes operational logs separately from SQLite. Cached public results are shared by target; this is not private per-user storage. Quotas and alert cooldown live in memory.
Read the diagram and its limits
The community user initiates the execution by invoking the slash command. Discord Gateway dispatches the event over WebSocket to the interaction router.
The interaction router applies an in-memory quota per user and logs events to Winston. After validating the domain, the command starts HTTP, TLS, RDAP, and DNS checks in parallel.
SQLite WAL keeps DNS and RDAP results for up to 30 minutes. HTTP and TLS connect to the target directly.
Promise.allSettled keeps the available results when an individual check rejects. Discord.js sends the summary and text attachment to the channel.
This diagram follows the domain report. The local checks used real SQLite with simulated Discord and network transports. The author reports the deployment.
Implementation map. Domain audit implemented and verified locally with simulated transports; production hosting reported by author.
Domain report journey
1. An interaction requests a domain report. The router applies the user quota and the command validates input. Invalid targets receive an ephemeral rejection before source queries.
2. The command defers its reply without an ephemeral flag and launches DNS, RDAP, HTTP and TLS through Promise.allSettled. DNS and RDAP use local cache; HTTP and TLS are inspected on every execution. Direct target connections are involved, so the entire journey should not be described as strictly passive.
3. Results are retained or marked as failures. A formatter produces text and the command serializes an embed and attachment. The local check observed both, two cache entries and RDAP reuse on a second request. Discord and transports were simulated; no message was delivered to a real server.
Concurrency, integrity and recovery
The cache primary key and upsert prevent duplicate rows for one key. Eight identical RDAP queries overlapped before their simulated transports responded: all eight completed, one row remained and eight calls were made. There is no coalescing of in-flight requests or guaranteed savings during concurrent bursts.
Cache survived SQLite closure and reopening. Expired entries or invalid JSON are removed on read. A simulated TLS failure produced a partial report and a retry recovered that source.
When SQLite cannot write, DNS/RDAP appear as failed sources even when their simulated responses are valid; HTTP/TLS remain visible. There is no fallback for returning those results without storing cache. The anti-raid window can rebuild recent joins from SQLite, but quotas and the last-alert timestamp do not survive process restart.
Decisions
The bot separates the report into stages. The command validates input, the services query the sources, and the formatter prepares the summary and attachment posted in Discord.
Validate input before looking it up
- Benefit
- The command checks the allowed input format. The invalid-target check stopped before any provider call or cache write.
- Cost and limits
- Input validation covers the domain format. Interpreting signals and the data from each source requires its own review.
- In plain terms
- Invalid input is rejected before the bot requests data.
Query the sources separately
- Benefit
- The report keeps results from sources that responded when another source rejects the lookup.
- Cost and limits
- The DNS service can return empty records after a failure. That result can also appear when records are absent.
- In plain terms
- The report can remain useful if TLS fails. An empty DNS section needs additional review.
Reuse DNS and RDAP in SQLite
- Benefit
- The cache stores previous lookups with an expiry. The checks confirmed reuse and reopening of the database.
- Cost and limits
- Eight identical overlapping lookups made eight simulated calls and left a single row. Cached data can age until it expires.
- In plain terms
- A stored lookup can be reused. Several requests arriving together may look it up again.
Separate summary and detail
- Benefit
- The summary shows the main signals and the attachment collects the lookup details.
- Cost and limits
- The report appears in the channel. HTTP and TLS checks open connections to the target.
- In plain terms
- People who can access the channel can read the result and its attachment.
Security and privacy
Implemented: Zod target validation, rejection of certain local or reserved destinations, per-command/user limits and administrative permission checks. For direct HTTP/TLS inspection, the code resolves and validates addresses before connecting. These are specific controls, not evidence of universally absent SSRF or an external audit.
Verified with simulated interactions: server audit rejects users without permission and direct messages; an authorized user receives ephemeral output. The consolidated report, urlscan and file analysis defer replies publicly. Ephemeral only limits visibility within Discord.
Depending on the command, external services receive domains and IPs; VirusTotal can receive a URL or file contents, and urlscan receives the URL. Its default is unlisted, which does not mean private. Confidential documents should not be submitted.
Logs are not anonymous: edits and deletions retain identifiers and message excerpts. The phishing detector avoids logging a complete message, but that property does not extend to all audit events. Log retention/access, secret history and emergency capabilities require separate operational review.
Testing
The review used an isolated copy of 97 files on Node.js 22.23.2. Dependencies from an earlier lab were reused after matching the lockfile. A network block and an environment without credentials isolated the run from operational services. SQLite was created inside the copy.
Syntax checks passed across 94 files. The original suite passed 37/37 cases across 21 files. The 10/10 additional checks ran the router, commands, services and formatting with real SQLite and simulated Discord, DNS, RDAP, HTTP and TLS.
The partial report retained HTTP when TLS failed. The checks also observed repeated overlapping calls, cache write failures and an empty DNS result after a simulated failure. Startup without credentials stopped at configuration validation. The operational instance and providers remain separate checks.
| Check | Result | Scope |
|---|---|---|
| Original suite | 37/37 · 21 files | No failures or skipped cases; utilities and modules with Discord doubles. Real in-memory SQLite for cache. |
| Additional checks | 10/10 | Router → real services → SQLite WAL → embed/attachment. Discord, DNS, RDAP, HTTP and TLS simulated. |
| Bounded concurrency | 8 queries · 8 calls · 1 row | Overlap barrier and simulated transports; establishes absence of coalescing, not maximum throughput. |
| Failures and recovery | Partial report and retry; limit reproduced | Simulated TLS recovers. Read-only cache degrades DNS/RDAP without fallback. |
| Permissions and quotas | Rejections and independent user quota | Audit denied/allowed/DM; fourth report blocked, other user allowed. Simulated interactions. |
| Startup and sample | Configuration rejected · 5 assertions | No real login. Public formatting sample executed without services. |
Deployment
The project began in 2023. The author reports the bot deployed and operational in production. The application requires Node.js 20 or later and configuration for Discord and enabled services.
The lab copy ran without credentials and with network access blocked. Startup stopped during configuration validation. Availability, audio and integrations in the operational instance require their own checks.
Outcome
A user can look up a domain and review its summary and attached report from Discord. The lab checked that useful results remain when TLS fails and that a retry can recover it.
The author reports operational use. Adoption, time savings, availability and detection accuracy remain separate measurements.
Evidence
The local run covered the router, report, SQLite, modeled permissions and retries. The concurrency check overlapped eight calls with a simulated transport. The test user and domain were fictional.
Development and operational use are attributed to the author. Discord, DNS, RDAP, HTTP and TLS were replaced during the journey. Production metrics and current providers require separate checks. The diagram and formatting sample describe the public workflow with synthetic data.
Software quality and UX
The experience centers on a concrete question and a readable report: per-source summaries, unavailable fields and explicit rejections. Empty DNS records need care: they do not establish a successful lookup. The attachment is product output checked through serialization; this page does not offer evidence downloads.
Rejections distinguish invalid input, insufficient permissions and exhausted quotas. They do not verify identity or establish external confidentiality. A result with no detections or a favorable header score still needs interpretation.
The formatting function bounds long labels while preserving a valid zero. The following sample isolates that presentation contract without exposing security logic, providers or operational data.
Code sample and engineering test
Public adaptation of the text truncation used to present results. Dependency-free JavaScript; the test requires Node.js and its assert module. Function and test are executed consecutively exactly as displayed. Length counts UTF-16 units; ellipsis use assumes a maximum of at least 3. This does not test the bot or Unicode grapheme handling.
function truncate(value, max = 80, fallback = 'N/A') { |
const text = value === null || value === undefined || value === '' |
? fallback : String(value); |
if (text.length <= max) return text; |
return text.slice(0, Math.max(0, max - 3)) + '...'; |
} |
Isolated sample test
import assert from 'node:assert/strict'; |
|
assert.equal(truncate(0), '0'); |
assert.equal(truncate(null), 'N/A'); |
assert.equal(truncate(''), 'N/A'); |
const label = 'Synthetic observation'; |
assert.equal(truncate(label, 12), 'Synthetic...'); |
assert.equal(label, 'Synthetic observation'); |
console.log('PASS: 5 assertions'); |
Local result: PASS: 5 assertions. Preserves zero, distinguishes absence, bounds a long label and leaves the input intact. No external calls.