Skip to main content
An ABUSE_REQUESTS shutdown means your application was making API calls to the Discord or Amino APIs at a rate the platform considers abusive — either exceeding the API provider’s own rate limits, or generating an unsustainably high volume of requests in a short period. Virtus Cloud monitors outbound API traffic and shuts down applications that could endanger shared network resources or cause your bot’s API access to be suspended. Fixing this error requires you to understand where the excessive requests are coming from and restructure your code to operate within safe limits.

When Does It Occur?

You’ll see the following message in your application logs when the platform enforces the request limit:
[SQUARE-SHIELD] ABUSE_REQUESTS
The application is stopped immediately. Common triggers include a sudden spike in user activity, a newly deployed feature that makes repeated API calls in a tight loop, or caching code that was accidentally removed or disabled.

Why Does It Occur?

This error arises when your application exceeds the permissible request rate to the Discord and/or Amino APIs. Root causes typically include:
  • Inefficient event handlers — responding to every message or event with one or more API calls, without any debouncing or deduplication.
  • Missing caching — fetching the same guild, channel, user, or role data repeatedly instead of caching it after the first fetch.
  • Tight polling loops — periodically checking an API endpoint in a loop without any meaningful delay between requests.
  • Rapid user growth — a legitimate increase in user activity causing proportionally more API calls than your application was originally designed to handle.

How to Fix It

Monitor and Optimize Your Code

1

Identify the source of excessive requests

Add logging around every API call in your application. Look for sections of code that call the Discord or Amino API inside event handlers that fire frequently — such as messageCreate, interactionCreate, or guildMemberUpdate. Log the call count per minute to quantify the problem.
2

Eliminate unnecessary API calls

Review every API call and ask whether it’s essential. For example:
  • If you’re fetching a user’s roles on every message, cache them instead.
  • If you’re calling channel.fetch() to get a channel object that the event already provides, use the event’s built-in data instead.
  • If you’re sending status updates to multiple channels, consider whether a single channel would suffice.
3

Add rate-limit handling

Implement exponential backoff or queue-based request handling so that if the API returns a rate-limit response (HTTP 429), your application waits the appropriate time before retrying rather than hammering the endpoint.

Implement Caching

Caching is the single most effective way to reduce API request volume. Store data that doesn’t change frequently in memory and reuse it for subsequent requests:
The discord.js Client automatically caches guilds, channels, roles, and members in its internal Collection objects. Access cached data through client.guilds.cache.get(id), guild.channels.cache.get(id), etc., rather than calling .fetch() methods, which always make a fresh API request.
For data that changes occasionally, implement a simple time-to-live (TTL) cache in memory. Store the result of an API call alongside a timestamp, and only refresh it after the TTL expires:
const cache = new Map();
const CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes

async function getCachedData(key, fetchFn) {
  const cached = cache.get(key);
  if (cached && Date.now() - cached.timestamp < CACHE_TTL_MS) {
    return cached.data;
  }
  const data = await fetchFn();
  cache.set(key, { data, timestamp: Date.now() });
  return data;
}

Keep Your Libraries Updated

Outdated library versions sometimes include inefficient API usage patterns or bugs that generate unnecessary requests. Update to the latest stable release:
npm install discord.js@latest
Or update the version pin in your dependency manifest and redeploy:
{
  "dependencies": {
    "discord.js": "^14.14.1"
  }
}

Request a Higher Limit

If your application genuinely needs to make more API requests than the current limit allows — for example, because it serves a very large and active community — contact the Discord or Amino support teams directly to request an increased rate limit for your bot. Provide context about your bot’s purpose, its user base, and the steps you’ve already taken to optimize request volume.

Test and Verify

After making your optimizations, thoroughly test your application under simulated load before redeploying to production. Verify that the request volume stays within acceptable bounds, then restart your application from the dashboard and monitor the logs for any recurrence of the ABUSE_REQUESTS shutdown.
If you continue to experience ABUSE_REQUESTS shutdowns after optimizing your code, contact the Virtus Cloud support team.