Before connecting
✗ There is no .env file in this folder.
✗ There is no .env file in this folder.
chapterjs dev needs BOT_TOKEN and DEV_GUILD_ID. Copy .env.example to .env and fill them in: see Your Discord application.✗ .env: BOT_TOKEN is empty. / is still the example value.
✗ .env: BOT_TOKEN is empty. / is still the example value.
Environment: instead of .env: when the value came from the environment and not from the file.✗ .env: BOT_TOKEN contains a space, so it is not a whole token.
✗ .env: BOT_TOKEN contains a space, so it is not a whole token.
Bot in front of it is fine: it is removed.✗ .env: DEV_GUILD_ID is empty.
✗ .env: DEV_GUILD_ID is empty.
✗ DEV_GUILD_ID is "…", which is not a server ID (an ID only has digits).
✗ DEV_GUILD_ID is "…", which is not a server ID (an ID only has digits).
✗ BOT_TOKEN is not set.
✗ BOT_TOKEN is not set.
chapterjs start found no .env file and no BOT_TOKEN in the environment. On a host, give BOT_TOKEN in its settings (often called “environment variables” or “secrets”), or put it in a .env file next to package.json. The environment wins when both are there.✗ There is no src folder here.
✗ There is no src folder here.
package.json. To start a project, run pnpm create chapterjs.✗ Discord refused the bot token.
✗ Discord refused the bot token.
BOT_TOKEN. Nothing can work until it is fixed, so the command stops.✗ Discord could not be reached for GET …
✗ Discord could not be reached for GET …
✗ Discord refused a request the framework needs to start: …
✗ Discord refused a request the framework needs to start: …
⚠ Your bot is not in your dev server yet (DEV_GUILD_ID=…).
⚠ Your bot is not in your dev server yet (DEV_GUILD_ID=…).
chapterjs dev waits (Waiting for the bot to be added...) and goes on by itself with ✓ The bot joined …. If the link shows another server, DEV_GUILD_ID is not the ID of a server you manage. Started by another program, the same message is a ✗ and the command stops.⚠ Your files need an option that is not enabled for your bot: …
⚠ Your files need an option that is not enabled for your bot: …
messageCreate and messageUpdate, Server Members Intent for memberJoin, memberLeave, memberUpdate, threadMemberJoin and threadMemberLeave, Presence Intent for presenceUpdate. The message lists the files that need each one and gives the link to the right page: enable the option under Privileged Gateway Intents, then save. In a terminal, chapterjs dev waits (Waiting for you to enable it...) and goes on with ✓ Privileged intents enabled. Started by another program, and always with chapterjs start, the same message is a ✗ and the command stops. See Privileged intents.✗ Discord refused the connection: the bot uses privileged intents (…) that are not enabled.
✗ Discord refused the connection: the bot uses privileged intents (…) that are not enabled.
✗ The bot needs to start N session(s) but Discord only allows M more until …
✗ The bot needs to start N session(s) but Discord only allows M more until …
✗ The bot is in too many servers for a single connection: it must use more shards.
✗ The bot is in too many servers for a single connection: it must use more shards.
✗ Discord refused the shard of this connection … / ✗ Discord refused the intents sent by the framework. This is a bug in ChapterJS
✗ Discord refused the shard of this connection … / ✗ Discord refused the intents sent by the framework. This is a bug in ChapterJS
✗ Discord no longer accepts the gateway version this version of ChapterJS speaks: update ChapterJS.
✗ Discord no longer accepts the gateway version this version of ChapterJS speaks: update ChapterJS.
chapterjs package of your project, then build and start again.✗ Discord closed the connection for good (close code …).
✗ Discord closed the connection for good (close code …).
ℹ Nothing to run yet: export a command or an event from a file of src/, like export default command({ name: 'ping', ... })
ℹ Nothing to run yet: export a command or an event from a file of src/, like export default command({ name: 'ping', ... })
src/ declares no command and no event. The bot still connects. Declare one: see Project structure.While your bot runs
✗ src/…:line …, then ⚠ Reloaded with an error: that file keeps running its last working version
✗ src/…:line …, then ⚠ Reloaded with an error: that file keeps running its last working version
✗ src/…:line … (while the bot runs)
✗ src/…:line … (while the bot runs)
✗ src/…:line …, then This call was not awaited: write await in front of it (and async before run)
✗ src/…:line …, then This call was not awaited: write await in front of it (and async before run)
await, and it failed with nobody to tell. Without this line, Node would have stopped the bot; instead the error is reported with your file and line, and the bot keeps running. Write await in front of the call and async before run, so that your function waits for it and its errors are reported with it.↻ Your files now need more from Discord (…): reconnecting...
↻ Your files now need more from Discord (…): reconnecting...
✓ Reconnected, … loaded; if that needs a privileged intent, see above.ℹ … only works in private messages, and chapterjs dev only runs your bot in …
ℹ … only works in private messages, and chapterjs dev only runs your bot in …
chapterjs dev only runs your bot in your test server, so a command or an event of private messages only can’t be tried there. It works with chapterjs start.ℹ /name is not the same here as in production, so … shows it twice
ℹ /name is not the same here as in production, so … shows it twice
✗ Discord refused the commands of your project: …
✗ Discord refused the commands of your project: …
⚠ Connection to Discord lost, reconnecting...
⚠ Connection to Discord lost, reconnecting...
↻ Reconnected to Discord. Your files keep running.⚠ src/commands/… /name finished without answering: the person sees "The application did not respond". Call interaction.reply() in run.
⚠ src/commands/… /name finished without answering: the person sees "The application did not respond". Call interaction.reply() in run.
run function returned without calling interaction.reply(). Every command must answer: see Answering.⚠ src/commands/… /name was used in a channel the bot can't answer in (…): it did not run.
⚠ src/commands/… /name was used in a channel the bot can't answer in (…): it did not run.
⚠ A … event was not given to your files: Discord did not let the bot read the channel it happened in (…).
⚠ A … event was not given to your files: Discord did not let the bot read the channel it happened in (…).
⚠ A … event was not given to your files: Discord did not let the bot read the user who did it (…).
⚠ A … event was not given to your files: Discord did not let the bot read the user who did it (…).
⚠ Voice: the bot asked to speak on the stage …: a moderator must accept, or give it the Mute Members permission so it speaks by itself.
⚠ Voice: the bot asked to speak on the stage …: a moderator must accept, or give it the Mute Members permission so it speaks by itself.
⚠ Voice: the voice server refused the bot (…): …
⚠ Voice: the voice server refused the bot (…): …
voice.connected is now false. Join again; if it keeps happening, open an issue with the message.⚠ Voice: the end-to-end encryption of the call could not be updated (transition …): joining it again.
⚠ Voice: the end-to-end encryption of the call could not be updated (transition …): joining it again.
⚠ Voice: the bot lost its voice connection: …
⚠ Voice: the bot lost its voice connection: …
⚠ An event of Discord (…) could not be read: …
⚠ An event of Discord (…) could not be read: …
ℹ A new version of chapterjs is out: … (you have …). To update, run: …
ℹ A new version of chapterjs is out: … (you have …). To update, run: …
chapterjs dev again. The third line links to what changed. Nothing is installed by itself.ℹ Memory was getting full (…): the bot now remembers … members per server at most
ℹ Memory was getting full (…): the bot now remembers … members per server at most
ℹ Memory is fine again: the bot remembers up to … members per server again. says so.⚠ The bot uses … of the … of memory it can use, and already remembers as little as it can
⚠ The bot uses … of the … of memory it can use, and already remembers as little as it can
Map you add to and never empty). A lot, and it is still full: your bot is large; give it more memory with NODE_OPTIONS=--max-old-space-size=4096 (in MB) on a machine that has that much. See Memory.⚠ Process N of M stopped by itself (…): starting it again. Its servers are back in a moment.
⚠ Process N of M stopped by itself (…): starting it again. Its servers are back in a moment.
[N] just before to see why it stopped.✗ Something unexpected happened: … This is probably a bug in ChapterJS
✗ Something unexpected happened: … This is probably a bug in ChapterJS
Building and starting
✗ Your project has type errors, so it was not built:
✗ Your project has type errors, so it was not built:
typecheck script of your project. The build never ships a file that does not type-check.ℹ Types were not checked: TypeScript is not installed in this project (or it has no tsconfig.json).
ℹ Types were not checked: TypeScript is not installed in this project (or it has no tsconfig.json).
tsconfig.json of the template.✗ This file can't run, so your bot was not built. / can't be compiled / can't run once compiled
✗ This file can't run, so your bot was not built. / can't be compiled / can't run once compiled
chapterjs dev does when you save it. Fix them and build again. can't be compiled is a file the compiler could not read; can't run once compiled is a file that runs from src/ but not in the compiled bot.✗ There is no build of your bot here.
✗ There is no build of your bot here.
chapterjs start runs what chapterjs build prepared, and nothing else. Run the build script first, on the same machine or before uploading .chapterjs/build.✗ This build was made with chapterjs X, and this is chapterjs Y.
✗ This build was made with chapterjs X, and this is chapterjs Y.
chapterjs build again.⚠ Your files changed since the last build: the bot runs the build, not your changes.
⚠ Your files changed since the last build: the bot runs the build, not your changes.
chapterjs build, then start again.✗ The build of your bot can't run any more: …
✗ The build of your bot can't run any more: …
chapterjs build again: it says what to fix.✗ This file of the build can't run any more, so the bot was not started.
✗ This file of the build can't run any more, so the bot was not started.
chapterjs build again: it says what to fix.✗ chapterjs start takes one option: --processes followed by a number, like "chapterjs start --processes 4". Got "…".
✗ chapterjs start takes one option: --processes followed by a number, like "chapterjs start --processes 4". Got "…".
chapterjs start only takes --processes with a whole number of 1 or more. With a package manager, put -- before the option when it needs it: npm run start -- --processes 4.✗ "…" is not a command.
✗ "…" is not a command.
chapterjs CLI has five commands: dev, build, start, test and sync. The usage printed below the message lists them.Testing
✗ This file can't run, so your bot was not tested.
✗ This file can't run, so your bot was not tested.
chapterjs dev does when you save it. Nothing is tested until every file runs: fix them and test again.✗ Checked src/…: command /name failed in N of M cases
✗ Checked src/…: command /name failed in N of M cases
ℹ No scenario yet. Write one in a *.test.ts file of src/ with scenario() from 'chapterjs/test' to check what your bot answers.
ℹ No scenario yet. Write one in a *.test.ts file of src/ with scenario() from 'chapterjs/test' to check what your bot answers.
✗ Tested src/….test.ts: "label" failed
✗ Tested src/….test.ts: "label" failed
⚠ src/….test.ts declares no scenario: export one made with scenario() from 'chapterjs/test'
⚠ src/….test.ts declares no scenario: export one made with scenario() from 'chapterjs/test'
*.test.ts file exports nothing made with scenario(). The bot never loads these files, so what is in it runs nowhere: export a scenario, or rename the file.… took more than 10 s: is something waiting for an answer that never comes?
… took more than 10 s: is something waiting for an answer that never comes?
bot.use() or a bot.click() waits for a function that never answers, or a cooldown refuses the second use: time does not pass in the test server.What people see on Discord
The application did not respond
The application did not respond
run function finished without calling interaction.reply(). chapterjs dev warns you (⚠ … finished without answering). Every command must answer: see Answering.This interaction failed
This interaction failed
run finished without answering. chapterjs dev warns you (⚠ … finished without answering). Answer with interaction.update(), interaction.reply(), or interaction.deferUpdate() to change nothing: see Buttons.⚠ … was still running when its next time came: that run was skipped.
⚠ … was still running when its next time came: that run was skipped.
⚠ … was due while the bot was not connected: that run was skipped.
⚠ … was due while the bot was not connected: that run was skipped.
Something went wrong while running this command.
Something went wrong while running this command.
run function threw. The person gets this short answer, privately; you get the error with the file and the line in your terminal. When Discord refused an action for a missing permission, the person reads “I don’t have the permission to do that here.” instead.This command can only be used in a server. / in a private message with me. / can not be used here.
This command can only be used in a server. / in a private message with me. / can not be used here.
where in the file: see Servers and private messages.You need the … permission to use this command.
You need the … permission to use this command.
permissions, where they used it. See Who can use a command.You can use this command again in …
You can use this command again in …
cooldown, and the person used it too soon. That is what you asked for: see Cooldowns. The answer deletes itself when the cooldown ends; past 15 minutes it shows the date and time instead.These answers are in English
These answers are in English
A command is missing, or shown twice
A command is missing, or shown twice
chapterjs dev, and everywhere with chapterjs start. If one is missing, the terminal said why when it started: a name Discord refused, or two files that are the same command. Shown twice: see One bot for dev and production. A command the person can’t see is one whose permissions they don’t have: see Who can use a command.The bot stays online after I stopped it
The bot stays online after I stopped it
Ctrl+C once and let it disconnect: you see ✓ Disconnected and the bot goes offline at once. A second Ctrl+C stops the process without waiting, and Discord then keeps the bot online until it notices the connection is gone.