Skip to main content
You went from an empty folder to a bot that is online for everyone. Here is what you know, the habits worth keeping, and where to look from now on.

What you can do now

  • Create a project with create chapterjs, give it a token and a test server, run it with chapterjs dev.
  • Write a command with command(), with options typed for you, answers public or private, slow or immediate.
  • React to events with an event() per reaction, members and messages included, with intents worked out from your files.
  • Add buttons, menus and forms named by their export, carrying data, surviving restarts.
  • Reuse embeds and build messages out of components.
  • Schedule tasks, set the presence, and speak several languages with t.
  • Test your bot without Discord: every file once by itself, and your scenarios with scenario().
  • Build and deploy, with a second application for production.

Habits that keep a bot healthy

  • Read the terminal. Every message says what happened, then what to do. A ✗ with a file and a line is the fastest route to a fix.
  • Let the editor work for you. When something is underlined, it is a mistake that would have reached a person. When nothing is completed, run chapterjs sync.
  • Keep run short, and the logic in src/lib/.
  • Think about who reads a message: ephemeral for the person, allowedMentions for texts you repeat, t for the language.
  • Ask Discord for the least: the fewest privileged intents, the fewest permissions in the invite link.
  • Test before every build, build before every deploy, and never share a token.

Where to look

Ideas for your bot

A few things that fit in a file each, with what you learned:
  • /poll with a string option per answer, sending a poll (sending messages).
  • A messageCreate file that answers “gg” with a reaction (message events).
  • A /ticket command that opens a form and creates a private thread with channel.startThread() (forms, channels).
  • A memberUpdate file that logs nickname changes in a channel (events).
  • A task that posts the number of members every Sunday (tasks, translations).
Each of these is a page of the Guide away. Enjoy your bot.

Guide

One page per feature.

Reference

Everything, structure by structure.