WhatsApp banea cuentas que envían demasiados mensajes en poco tiempo. El rate limiter integrado del provider Baileys protege tu bot automáticamente — está activo por defecto y se sitúa dentro del pipeline de envío saliente del provider, así que cada ctx.reply(), bot.send(), bot.broadcast() y envío de media pasa por él.
Pacing propio de cada transporteEn v2 la política de pacing vive en el provider, no en el core: cada
transporte puede aplicar sus propios límites (429s de Telegram, buckets de
Discord, tiers de la Cloud API — expuestos como RateLimitedError tipados).
Esta página cubre el limiter de token bucket de WhatsApp (Baileys) que
configuras al construir BaileysProvider.
El limiter usa un algoritmo de token bucket con dos buckets independientes:
Por chat — limita qué tan rápido puedes enviar a una sola conversación.
Global — limita tu throughput saliente total entre todos los chats.
Cuando un bucket se vacía, los mensajes se encolan (no se descartan) y se liberan conforme los tokens se recargan; un chat frenado no retiene a los demás. Un envío que espera en la cola más de maxWait (30 s por defecto) rechaza con RateLimiterTimeout, un RateLimitedError, así que quien envía nunca se queda colgado. Un jitter opcional agrega un delay aleatorio tipo humano entre envíos.
Las cuentas nuevas son más sensiblesUn número de WhatsApp recién registrado se banea más rápido que uno con antigüedad. Empieza conservador (3 / 10s por chat, 20 / 60s global) y aumenta gradualmente.
Sea cual sea el transporte, un envío de ctx (reply, say, media, en
handlers, flujos y conversaciones) que el provider rechaza con un
RateLimitedError que pide una espera corta se reintenta en el sitio, para que
un paso de conversación no termine por un 429 pasajero: por defecto una vez,
cuando retryAfterMs es de 5 s como mucho. BotConfig.rateLimitRetry lo ajusta
(retries cuenta los intentos después del primero):
new Bot({ provider, rateLimitRetry: { retries: 2, maxWaitMs: '10s' } })new Bot({ provider, rateLimitRetry: false }) // nunca reintentar en el sitio
Una espera más larga, otros errores y bot.send() fallan como antes;
bot.broadcast() (su opción retries) y el outbox durable tienen su propio
back-off.
El rate limiter corre después de los hooks before('send') pero antes del envío real al provider. Si un hook aborta el envío, el rate limiter nunca se consulta — los envíos abortados no consumen tokens.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"botmesh","description":"A transport-agnostic TypeScript framework for messaging bots: WhatsApp (Baileys or the Cloud API), Telegram, Discord and more behind one IProvider.","colors":{"primary":"#3451B2","light":"#A8B1FF","dark":"#3451B2"},"logo":{"light":"https://mintcdn.com/afaya/32LyKbpS8BIF3Yl-/logo/light.svg?fit=max\u0026auto=format\u0026n=32LyKbpS8BIF3Yl-\u0026q=85\u0026s=5a9c4db10ba52bbd645a009cc009e31e","dark":"https://mintcdn.com/afaya/32LyKbpS8BIF3Yl-/logo/dark.svg?fit=max\u0026auto=format\u0026n=32LyKbpS8BIF3Yl-\u0026q=85\u0026s=be155346190b752c815b6d06f1134702"},"favicon":"https://mintcdn.com/afaya/32LyKbpS8BIF3Yl-/favicon.svg?fit=max\u0026auto=format\u0026n=32LyKbpS8BIF3Yl-\u0026q=85\u0026s=abe4b13c733adb336381bebc0220d3e5","navbar":{"links":[{"href":"https://www.npmjs.com/package/@botmesh/core","label":"npm"}],"primary":{"type":"github","href":"https://github.com/andresayac/botmesh"}},"footer":{"socials":{"github":"https://github.com/andresayac/botmesh"},"links":[{"header":"Project","items":[{"label":"GitHub","href":"https://github.com/andresayac/botmesh"},{"label":"npm","href":"https://www.npmjs.com/package/@botmesh/core"},{"label":"MIT License","href":"https://github.com/andresayac/botmesh/blob/main/LICENSE"},{"label":"Changelog","href":"https://github.com/andresayac/botmesh/blob/main/CHANGELOG.md"}]}]},"search":{"prompt":"Search the botmesh docs…"},"seo":{"indexing":"navigable"},"icons":{"library":"lucide"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"languages":[{"language":"en","default":true,"href":""},{"language":"es","footer":{"socials":{"github":"https://github.com/andresayac/botmesh"},"links":[{"header":"Proyecto","items":[{"label":"GitHub","href":"https://github.com/andresayac/botmesh"},{"label":"npm","href":"https://www.npmjs.com/package/@botmesh/core"},{"label":"Licencia MIT","href":"https://github.com/andresayac/botmesh/blob/main/LICENSE"},{"label":"Changelog","href":"https://github.com/andresayac/botmesh/blob/main/CHANGELOG.md"}]}]},"href":"es"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"afaya","hasAudioNarration":false,"actualSubdomain":"afaya","customDomains":["botmesh.afaya.com.co"],"gitSource":{"type":"github","owner":"andresayac","repo":"botmesh-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":"","_id":"6ae0b3e80b849c49dba39507"},"chroma":{"latestBuiltDeploymentHistoryId":"6ae0b3f8dc8e261a8bb682ee","collectionId":"af19fec4-32c9-4ad1-b8a5-5db01ce875d1","liveDeploymentHistoryId":"6ae0b3f8dc8e261a8bb682ee","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae0b3fe0b849c49dba39747","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"en","tag":"API reference","count":541},{"language":"en","tag":"@botmesh/core","count":373},{"language":"en","tag":"@botmesh/core/testing","count":93},{"language":"en","tag":"@botmesh/core/spi","count":75},{"language":"en","tag":"Guide","count":53},{"language":"es","tag":"Guía","count":53},{"language":"en","tag":"Golden transcripts","count":41},{"language":"en","tag":"Durability","count":35},{"language":"en","tag":"Flows","count":34},{"language":"en","tag":"Messages \u0026 context","count":32},{"language":"en","tag":"Forms","count":30},{"language":"es","tag":"Ejemplos","count":29},{"language":"es","tag":"Características","count":25},{"language":"es","tag":"Avanzado","count":19},{"language":"es","tag":"Intermedio","count":9},{"language":"es","tag":"Principiante","count":8},{"language":"es","tag":"Desarrollo y tests","count":8},{"language":"es","tag":"IA","count":6},{"language":"es","tag":"Primeros pasos","count":6},{"language":"es","tag":"Resumen","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"es/guide/rate-limiting","slug":"/es/guide/rate-limiting","pageMetadata":{"title":"Rate Limiting (Anti-Ban)","sidebarTitle":"Rate limiting (anti-ban)","description":null,"href":"/es/guide/rate-limiting"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Mermaid,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Mermaid)_missingMdxReference(`Mermaid`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`WhatsApp `,_jsx(_components.strong,{children:`banea cuentas`}),` que envían demasiados mensajes en poco tiempo. El rate limiter integrado del provider Baileys protege tu bot automáticamente — está `,_jsx(_components.strong,{children:`activo por defecto`}),` y se sitúa dentro del pipeline de envío saliente del provider, así que cada `,_jsx(_components.code,{children:`ctx.reply()`}),`, `,_jsx(_components.code,{children:`bot.send()`}),`, `,_jsx(_components.code,{children:`bot.broadcast()`}),` y envío de media pasa por él.`]}),`\n`,_jsxs(Tip,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Pacing propio de cada transporte`})}),_jsxs(_components.p,{children:[`En v2 la política de pacing vive en el `,_jsx(_components.strong,{children:`provider`}),`, no en el core: cada\ntransporte puede aplicar sus propios límites (429s de Telegram, buckets de\nDiscord, tiers de la Cloud API — expuestos como `,_jsx(_components.code,{children:`RateLimitedError`}),` tipados).\nEsta página cubre el limiter de token bucket de WhatsApp (Baileys) que\nconfiguras al construir `,_jsx(_components.code,{children:`BaileysProvider`}),`.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`cómo-funciona`,children:`Cómo funciona`}),`\n`,_jsxs(_components.p,{children:[`El limiter usa un algoritmo de `,_jsx(_components.strong,{children:`token bucket`}),` con dos buckets independientes:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Por chat`}),` — limita qué tan rápido puedes enviar a una `,_jsx(_components.em,{children:`sola`}),` conversación.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Global`}),` — limita tu throughput saliente `,_jsx(_components.em,{children:`total`}),` entre todos los chats.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Cuando un bucket se vacía, los mensajes se `,_jsx(_components.strong,{children:`encolan`}),` (no se descartan) y se liberan conforme los tokens se recargan; un chat frenado no retiene a los demás. Un envío que espera en la cola más de `,_jsx(_components.code,{children:`maxWait`}),` (30 s por defecto) rechaza con `,_jsx(_components.code,{children:`RateLimiterTimeout`}),`, un `,_jsx(_components.code,{children:`RateLimitedError`}),`, así que quien envía nunca se queda colgado. Un `,_jsx(_components.strong,{children:`jitter`}),` opcional agrega un delay aleatorio tipo humano entre envíos.`]}),`\n`,_jsx(Mermaid,{chart:`flowchart LR\n A[\"ctx.reply()\"] --> B[\"before('send') hooks\"]\n B --> C[\"RateLimiter.acquire(chatId)\"]\n C -->|\"tokens disponibles\"| D[\"provider.send()\"]\n C -->|\"bucket vacío\"| E[\"cola — esperar recarga\"]\n E --> D\n D --> F[\"after('send') hooks\"]`}),`\n`,_jsx(Heading,{level:`2`,id:`configuración`,children:`Configuración`}),`\n`,_jsxs(_components.p,{children:[`Pasa `,_jsx(_components.code,{children:`rateLimit`}),` al constructor del `,_jsx(_components.strong,{children:`provider`}),` (`,_jsx(_components.code,{children:`BotConfig.rateLimit`}),` está\nobsoleta: el core la ignora y avisa en el log):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Bot`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@botmesh/core'`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`BaileysProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@botmesh/baileys'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` bot`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Bot`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` provider:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` BaileysProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` session:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'mi-bot'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` rateLimit:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` perChat:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`max:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '10s'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// máx 5 msgs por chat cada 10s`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` global:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`max:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 50`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '60s'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// máx 50 msgs totales cada 60s`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` jitter:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`min:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 500`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`max:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1500`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// delay aleatorio 500–1500ms entre envíos`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Opción`}),_jsx(_components.th,{children:`Tipo`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Descripción`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`perChat.max`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5`})}),_jsx(_components.td,{children:`Máx mensajes por chat en la ventana`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`perChat.window`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string | number`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`'10s'`})}),_jsxs(_components.td,{children:[`Ventana de tiempo (ej. `,_jsx(_components.code,{children:`'10s'`}),`, `,_jsx(_components.code,{children:`'1m'`}),`, `,_jsx(_components.code,{children:`60000`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`global.max`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`50`})}),_jsx(_components.td,{children:`Máx mensajes totales en la ventana`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`global.window`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string | number`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`'60s'`})}),_jsx(_components.td,{children:`Ventana de tiempo`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`jitter.min`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0`})}),_jsx(_components.td,{children:`Delay mínimo entre envíos (ms)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`jitter.max`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`0`})}),_jsx(_components.td,{children:`Delay máximo entre envíos (ms)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`enabled`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`boolean`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})}),_jsxs(_components.td,{children:[`Pon `,_jsx(_components.code,{children:`false`}),` para desactivar completamente`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxWait`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string | number`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`'30s'`})}),_jsxs(_components.td,{children:[`Espera máxima en la cola antes de que el envío rechace con `,_jsx(_components.code,{children:`RateLimiterTimeout`}),` (`,_jsx(_components.code,{children:`0`}),` espera sin límite)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxChats`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`number`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5000`})}),_jsx(_components.td,{children:`Buckets por chat que se guardan en memoria (se expulsan primero los inactivos, así que nunca se levanta un límite activo)`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`desactivar-el-rate-limiting`,children:`Desactivar el rate limiting`}),`\n`,_jsx(_components.p,{children:`Para tests o entornos de alta confianza:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` bot`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Bot`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` provider:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` BaileysProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` session:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'mi-bot'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` rateLimit:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`enabled:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`configuraciones-recomendadas`,children:`Configuraciones recomendadas`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Escenario`}),_jsx(_components.th,{children:`perChat`}),_jsx(_components.th,{children:`global`}),_jsx(_components.th,{children:`jitter`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Soporte al cliente (bajo volumen)`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5 / 10s`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`30 / 60s`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`500–1500ms`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Notificaciones / broadcasts`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`3 / 10s`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`20 / 60s`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`1000–3000ms`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Flujos interactivos (respuestas rápidas)`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`10 / 10s`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`100 / 60s`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`200–500ms`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Desarrollo / tests`}),_jsx(_components.td,{children:`desactivado`}),_jsx(_components.td,{children:`desactivado`}),_jsx(_components.td,{children:`—`})]})]})]}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Las cuentas nuevas son más sensibles`})}),_jsxs(_components.p,{children:[`Un número de WhatsApp recién registrado se banea más rápido que uno con antigüedad. Empieza conservador (`,_jsx(_components.code,{children:`3 / 10s`}),` por chat, `,_jsx(_components.code,{children:`20 / 60s`}),` global) y aumenta gradualmente.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`acceso-programático`,children:`Acceso programático`}),`\n`,_jsxs(_components.p,{children:[`La instancia de `,_jsx(_components.code,{children:`RateLimiter`}),` es interna, pero puedes importar la clase desde el paquete de transporte para uso avanzado:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RateLimiter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@botmesh/baileys'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` limiter`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` RateLimiter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` perChat:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`max:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 5`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '10s'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` global:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`max:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 50`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`window:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '60s'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` limiter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`acquire`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'573001234567@s.whatsapp.net'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// resuelve cuando se permite`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`limiter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`pending`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// mensajes esperando en cola`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`limiter`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`reset`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// limpia buckets + rechaza envíos en cola`})]}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`2`,id:`límites-cortos-en-los-envíos-de-ctx`,children:[`Límites cortos en los envíos de `,_jsx(_components.code,{children:`ctx`})]}),`\n`,_jsxs(_components.p,{children:[`Sea cual sea el transporte, un envío de `,_jsx(_components.code,{children:`ctx`}),` (`,_jsx(_components.code,{children:`reply`}),`, `,_jsx(_components.code,{children:`say`}),`, media, en\nhandlers, flujos y conversaciones) que el provider rechaza con un\n`,_jsx(_components.code,{children:`RateLimitedError`}),` que pide una espera corta se reintenta en el sitio, para que\nun paso de conversación no termine por un 429 pasajero: por defecto una vez,\ncuando `,_jsx(_components.code,{children:`retryAfterMs`}),` es de 5 s como mucho. `,_jsx(_components.code,{children:`BotConfig.rateLimitRetry`}),` lo ajusta\n(`,_jsx(_components.code,{children:`retries`}),` cuenta los intentos después del primero):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Bot`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`rateLimitRetry:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retries:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 2`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`maxWaitMs:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '10s'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Bot`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`provider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`rateLimitRetry:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// nunca reintentar en el sitio`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Una espera más larga, otros errores y `,_jsx(_components.code,{children:`bot.send()`}),` fallan como antes;\n`,_jsx(_components.code,{children:`bot.broadcast()`}),` (su opción `,_jsx(_components.code,{children:`retries`}),`) y el outbox durable tienen su propio\nback-off.`]}),`\n`,_jsxs(Heading,{level:`2`,id:`interacción-con-hooks-before-send`,children:[`Interacción con hooks `,_jsx(_components.code,{children:`before('send')`})]}),`\n`,_jsxs(_components.p,{children:[`El rate limiter corre `,_jsx(_components.strong,{children:`después`}),` de los hooks `,_jsx(_components.code,{children:`before('send')`}),` pero `,_jsx(_components.strong,{children:`antes`}),` del envío real al provider. Si un hook aborta el envío, el rate limiter nunca se consulta — los envíos abortados no consumen tokens.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Rate Limiting (Anti-Ban)","sidebarTitle":"Rate limiting (anti-ban)","description":null,"href":"/es/guide/rate-limiting"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Cómo funciona","slug":"cómo-funciona","depth":2,"children":[]},{"title":"Configuración","slug":"configuración","depth":2,"children":[]},{"title":"Desactivar el rate limiting","slug":"desactivar-el-rate-limiting","depth":2,"children":[]},{"title":"Configuraciones recomendadas","slug":"configuraciones-recomendadas","depth":2,"children":[]},{"title":"Acceso programático","slug":"acceso-programático","depth":2,"children":[]},{"title":"Límites cortos en los envíos de ctx","slug":"límites-cortos-en-los-envíos-de-ctx","depth":2,"children":[]},{"title":"Interacción con hooks before('send')","slug":"interacción-con-hooks-before-send","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"afaya","siteName":"botmesh","title":"Rate Limiting (Anti-Ban) - botmesh","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/guide/rate-limiting","matchLevel":1},"es":{"href":"/es/guide/rate-limiting","matchLevel":0}}},"lastModified":"2026-10-27T14:26:08.439Z","originalFileLocation":"es/guide/rate-limiting.mdx","locale":"es"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"botmesh\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Rate Limiting (Anti-Ban) - botmesh\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"botmesh\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://botmesh.afaya.com.co/es/guide/rate-limiting\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://afaya.mintlify.app/_mintlify/api/og/v2?division=Caracter%C3%ADsticas\u0026amp;title=Rate+Limiting+%28Anti-Ban%29\u0026amp;theme=dea9f3ba838ba9e4866bef64\u0026amp;signature=cc423fba1a8ce4a9714f6973952a320018a99c0eedb435b3e21df1771c4c707b\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Rate Limiting (Anti-Ban) - botmesh\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://afaya.mintlify.app/_mintlify/api/og/v2?division=Caracter%C3%ADsticas\u0026amp;title=Rate+Limiting+%28Anti-Ban%29\u0026amp;theme=dea9f3ba838ba9e4866bef64\u0026amp;signature=cc423fba1a8ce4a9714f6973952a320018a99c0eedb435b3e21df1771c4c707b\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/afaya/omilwj1Ifh1eDwt5/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"botmesh\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3451B2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://botmesh.afaya.com.co/es/guide/rate-limiting\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/es/guide/rate-limiting.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"es\" href=\"https://botmesh.afaya.com.co/es/guide/rate-limiting\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://botmesh.afaya.com.co/guide/rate-limiting\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://botmesh.afaya.com.co/guide/rate-limiting\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://botmesh.afaya.com.co/#organization\",\"name\":\"botmesh\",\"url\":\"https://botmesh.afaya.com.co\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/afaya/32LyKbpS8BIF3Yl-/logo/light.svg?fit=max\u0026auto=format\u0026n=32LyKbpS8BIF3Yl-\u0026q=85\u0026s=5a9c4db10ba52bbd645a009cc009e31e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://botmesh.afaya.com.co#website\",\"name\":\"botmesh\",\"url\":\"https://botmesh.afaya.com.co\",\"publisher\":{\"@id\":\"https://botmesh.afaya.com.co/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://botmesh.afaya.com.co/es/guide/rate-limiting#webpage\",\"url\":\"https://botmesh.afaya.com.co/es/guide/rate-limiting\",\"name\":\"Rate Limiting (Anti-Ban)\",\"dateModified\":\"2026-10-27T14:26:08.439Z\",\"isPartOf\":{\"@id\":\"https://botmesh.afaya.com.co#website\"},\"breadcrumb\":{\"@id\":\"https://botmesh.afaya.com.co/es/guide/rate-limiting#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://botmesh.afaya.com.co/es/guide/rate-limiting#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Características\",\"item\":\"https://botmesh.afaya.com.co/es/guide/messages\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Rate Limiting (Anti-Ban)\",\"item\":\"https://botmesh.afaya.com.co/es/guide/rate-limiting\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://botmesh.afaya.com.co/es/guide/rate-limiting#article\",\"headline\":\"Rate Limiting (Anti-Ban)\",\"name\":\"Rate Limiting (Anti-Ban)\",\"url\":\"https://botmesh.afaya.com.co/es/guide/rate-limiting\",\"mainEntityOfPage\":{\"@id\":\"https://botmesh.afaya.com.co/es/guide/rate-limiting#webpage\"},\"dateModified\":\"2026-10-27T14:26:08.439Z\",\"publisher\":{\"@id\":\"https://botmesh.afaya.com.co/#organization\"},\"isPartOf\":{\"@id\":\"https://botmesh.afaya.com.co#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"botmesh\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"botmesh","nav":{"global":null,"languages":[{"language":"en","default":true,"pages":[{"title":"en","href":"/guide/rate-limiting"}]},{"language":"es","footer":{"socials":{"github":"https://github.com/andresayac/botmesh"},"links":[{"header":"Proyecto","items":[{"label":"GitHub","href":"https://github.com/andresayac/botmesh"},{"label":"npm","href":"https://www.npmjs.com/package/@botmesh/core"},{"label":"Licencia MIT","href":"https://github.com/andresayac/botmesh/blob/main/LICENSE"},{"label":"Changelog","href":"https://github.com/andresayac/botmesh/blob/main/CHANGELOG.md"}]}]},"tabs":[{"tab":"Guía","icon":"book-open","groups":[{"group":"Primeros pasos","pages":[{"title":"botmesh","sidebarTitle":"Inicio","mode":"wide","href":"/es"},{"title":"Inicio rápido","href":"/es/guide/getting-started"},{"title":"Tu primer bot","href":"/es/guide/first-bot"},{"title":"Conceptos básicos","href":"/es/guide/concepts"},{"title":"Referencia de configuración","href":"/es/guide/configuration"},{"title":"Canales (providers)","sidebarTitle":"Canales","href":"/es/guide/channels"}]},{"group":"Características","pages":[{"title":"Mensajes y media","href":"/es/guide/messages"},{"title":"Flujos conversacionales","href":"/es/guide/flows"},{"title":"Triggers especiales: WELCOME, tipos de mensaje y CALL","sidebarTitle":"Triggers especiales","href":"/es/guide/triggers"},{"title":"Formularios (WhatsApp Flows)","href":"/es/guide/forms"},{"title":"Datos persistentes por usuario (`ctx.user`)","sidebarTitle":"Datos por usuario","href":"/es/guide/user-data"},{"title":"Internacionalización (i18n)","href":"/es/guide/i18n"},{"title":"Handoff humano y listas de acceso","sidebarTitle":"Handoff y listas de acceso","href":"/es/guide/handoff"},{"title":"Hooks (middleware)","href":"/es/guide/hooks"},{"title":"Plugins","href":"/es/guide/plugins"},{"title":"Plugin de IA","href":"/es/guide/ai"},{"title":"Herramientas de IA (tool calling)","sidebarTitle":"Herramientas de IA","href":"/es/guide/ai-tools"},{"title":"Memoria y RAG","href":"/es/guide/ai-memory-rag"},{"title":"Respuestas en streaming (`ctx.stream`)","sidebarTitle":"Respuestas en streaming","href":"/es/guide/streaming"},{"title":"Voz (`@botmesh/voice`)","sidebarTitle":"Voz (STT/TTS)","href":"/es/guide/voice"},{"title":"Integraciones","href":"/es/guide/integrations"},{"title":"Inyección de dependencias","href":"/es/guide/di"},{"title":"Scheduler","description":"Ejecuta tareas programadas: cada cierto intervalo, con cron, o después de un delay. Cada método devuelve un ScheduledTask que puedes cancelar.","href":"/es/guide/scheduler"},{"title":"Rate Limiting (Anti-Ban)","sidebarTitle":"Rate limiting (anti-ban)","href":"/es/guide/rate-limiting"},{"title":"Store persistente","description":null,"href":"/es/guide/store"},{"title":"Control plane","href":"/es/guide/control-plane"},{"title":"Servidor de webhooks (`@botmesh/server`)","sidebarTitle":"Servidor de webhooks","href":"/es/guide/server"},{"title":"Ventana de 24 h y costos (Cloud API)","sidebarTitle":"Ventana de 24 h de WhatsApp","href":"/es/guide/session-window"},{"title":"Operación: métricas, eventos, inbox y entregas","sidebarTitle":"Operación","href":"/es/guide/operations"},{"title":"Trazas (OpenTelemetry)","href":"/es/guide/tracing"},{"title":"Procesamiento durable de mensajes","sidebarTitle":"Procesamiento durable","href":"/es/guide/durability"}]},{"group":"Desarrollo y tests","pages":[{"title":"Simulador en la terminal (`botmesh dev`)","sidebarTitle":"Simulador en la terminal","href":"/es/guide/dev-simulator"},{"title":"Sandbox de plataformas","href":"/es/guide/sandbox"},{"title":"Testing","href":"/es/guide/testing"},{"title":"Inspeccionar y validar flujos","href":"/es/guide/flow-tools"},{"title":"Esquema JSON de flujos","href":"/es/guide/flow-schema"},{"title":"Servidor MCP","href":"/es/guide/mcp"},{"title":"Transcripciones doradas","href":"/es/guide/golden-transcripts"},{"title":"Plugin de ESLint","href":"/es/guide/eslint"}]},{"group":"Avanzado","pages":[{"title":"Sub-APIs (v1) → escape hatches del transporte (v2)","sidebarTitle":"Sub-APIs","href":"/es/guide/sub-apis"},{"title":"Pasar a producción","href":"/es/guide/production"},{"title":"Despliegue","href":"/es/guide/deploy"},{"title":"Varias réplicas","href":"/es/guide/replicas"},{"title":"Arquitectura","href":"/es/guide/architecture"},{"title":"Redis Cluster","href":"/es/guide/redis-cluster"},{"title":"Seguridad","href":"/es/guide/security"},{"title":"Modelo de amenazas","href":"/es/guide/threat-model"},{"title":"Actualizar a estable: checklist y cambios de API","sidebarTitle":"Actualizar a estable: checklist y API","href":"/es/guide/stable-migration"},{"title":"Actualizar a estable: dependencias","href":"/es/guide/migration"},{"title":"Actualizar a estable: cambios de comportamiento","sidebarTitle":"Actualizar a estable: comportamiento","href":"/es/guide/migration-2"},{"title":"Notas de actualización: canales y plugins","href":"/es/guide/upgrade-channels-plugins"},{"title":"Solución de problemas","href":"/es/guide/troubleshooting"},{"title":"Preguntas frecuentes","href":"/es/guide/faq"}]}]},{"tab":"Ejemplos","icon":"chef-hat","pages":[{"title":"Ejemplos","href":"/es/examples"}]},{"tab":"Referencia de la API","icon":"code","href":"/api/core"}]}]},"title":"Rate Limiting (Anti-Ban) - botmesh","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":[],"chunks":[]}