Adapter for code ChatGPT wrote
ChatGPT’s bot won’t answer?
ChatGPT often writes discord.js v13 code from 2021. Version 14 (July 2022) renamed intents, events and builders, and Discord now hides message text unless the bot asks for it.
Fits Windows · Mac · Chrome · phoneWhy ChatGPT’s code doesn’t fit
- It learned from older code. Most of the code ChatGPT saw was written years ago, so it reaches for versions that have since changed: Chrome extensions on Manifest V2, Discord bots on discord.js v13.
- It leaves out the boring parts. Icons it mentions but never makes, a userscript header without a path, a token pasted straight into the code.
- It can’t install anything for you. It tells you to “load it unpacked” or “run npm install”, and stops there. The steps below each result are for your actual device.
What gets refitted
- Intents.FLAGS → GatewayIntentBits
- “message” → “messageCreate”, “interaction” → “interactionCreate”
- MessageEmbed → EmbedBuilder (and the other builders)
- 'PRIMARY' → ButtonStyle.Primary, 'BLUE' → 'Blue'
- setFooter / setAuthor / addField → object form
- MessageContent intent added when the bot reads messages
- token moved to a .env file