Skip to main content
chapterjs, create-chapterjs and create-chapter share one version number, following semantic versioning: only a major version asks you to change your files, and its entry says what. Only chapterjs lives in your project; chapterjs dev tells you when a newer one is out. To update it:
New templates
  • Templates: minimal, preselected, is a presence and nothing else; tickets, moderation, levels and giveaways are complete bots.
  • default, music, community and games are gone. Projects already made from them keep working.
  • The tutorial starts from minimal.
Menu commands, waiting, rotating presence
  • Menu commands: command({ type: 'message' | 'user', ... }), used with a right click.
  • Waiting for an answer: waitForMessage(), collectMessages(), waitForClick(), waitForReaction().
  • Presence: several activities in turn, texts that are functions.
  • A sixth template, games.
Fixes
  • chapterjs dev: a second default: true in a new file no longer removes commands from Discord.
  • chapterjs dev: a new file can no longer take the name of a store, command or component that already runs.
  • Events and commands exported together in a list all run: only the last one did.
  • A call refused by Discord that was not awaited (member.ban() without await) no longer stops the bot: it is reported with its line. chapterjs test no longer stops on one either.
  • An answer asked without await is no longer reported as “finished without answering”.
  • chapterjs dev: one save reloads once, even when the editor writes then renames the file, and on Linux the saves that follow are no longer missed.
  • A message with more than 5 rows of buttons and menus is refused before Discord with a clear message.
  • chapterjs test: each case runs on a fresh server (a /ban no longer breaks the cases after it), a command that defers is no longer failed after 5 s, a stuck run no longer blocks what follows, and join() says voice is not simulated.
  • channelCreate, channelUpdate, channelDelete: guild is never null, and channel is one of a server.
  • A store file in data/ with a damaged entry is refused with its name, instead of losing that entry the next time it is written.
  • A plural’s zero form is used for 0 in every language: English ignored it.
  • reply.opensForm() takes a form that carries data.
  • chapterjs test: the server refuses, as Discord does, to kick, ban or rename the owner or someone above the bot.
  • Clearer messages: permissions in words (“Ban Members”), what Discord refusals mean, syntax errors, Redis refusing at start, --processes above the shards, the dev server in start.
Redis, rankings, events with guild
To change in your files: every event now gives what it is about plus guild. See What each event gives; a file written the old way is underlined in your editor.
  • Stores in Redis: storage: 'redis', with REDIS_URL in .env.
  • Stores: increment(), getMany(), setMany(), deleteAll(); update() no longer loses a change made at the same time.
  • Rankings: ranking(), a score per member, always in order.
chapterjs test
  • chapterjs test: your bot checked against a Discord in memory, no token needed.
  • Scenarios: scenario() in *.test.ts files, from chapterjs/test.
  • Every template has a test script and a scenario to start from.
Storage and five templates
  • Stores: store() keeps data from one restart to the next, in data/.
  • Five templates: default, tickets, music, community, moderation.
  • A new project gets the exact version of chapterjs of create chapterjs.
A lighter default template
  • The default template no longer has the moderation example.
New version notice
  • chapterjs dev says when a newer chapterjs is out, with the command to update.
Your files, your order
To change in your files: commands and events take a name, languages a locale; components and tasks are named by their export. Files can be anywhere in src/. See Project structure.
  • The …File types are now …Declaration (CommandFile → CommandDeclaration…).
First version
  • Commands, events, components, tasks, voice, presence and translated messages.
  • chapterjs dev, build and start, and create chapterjs.