Free discord.js v14 rules for Cursor: stops the agent writing deprecated options

Disclosure: I run AgentCartridge, which sells paid rules packs and a paid Discord bot kit. This rules file is free and needs no signup. The page also links to the paid kit further down.

AI agents often write discord.js code from older tutorials. In 14.27 most of it still compiles, so it’s easy to miss. I put together a rules file that tells the agent the current forms. What it covers:

  1. reply({ ephemeral: true }) → reply({ flags: MessageFlags.Ephemeral }) (ephemeral is marked deprecated)
  2. reply({ fetchReply: true }) → reply({ withResponse: true }) (the message is then response.resource?.message)
  3. client.once("ready", ...) → client.once(Events.ClientReady, ...) (the “ready” event name is deprecated, the new name is “clientReady”)
  4. .setDMPermission(false) → .setContexts(InteractionContextType.Guild)
  5. v13 names that no longer exist in v14: MessageEmbed → EmbedBuilder, Intents.FLAGS → GatewayIntentBits, MessageActionRow/MessageButton → ActionRowBuilder/ButtonBuilder

It also has Discord’s limits: reply, deferReply or another first response within 3 seconds (otherwise “The application did not respond”), a 15 minute interaction token, 25 autocomplete choices, 2000 character messages, and the privileged intents (MessageContent, GuildMembers, GuildPresences). And a few safety rules: token only from an env var, and allowedMentions: { parse: [] } for user-typed text.

Setup: save it as .cursor/rules/discordjs-v14.mdc (it applies to .ts/.js files). The same body also works pasted into CLAUDE.md or AGENTS.md. Then ask the agent to check your existing commands against it once.

The full file is on the page, so you can copy it directly: Free discord.js v14 Rules for Cursor & Claude Code: No More Deprecated ephemeral, fetchReply or ready | AgentCartridge

If a rule is wrong for your setup or too strict, let me know and I’ll fix it.