By example¶
Twelve chapters that start with a single message and end with your own store. Read them in order, or jump to the one you need.
Build a view¶
-
Describe a whole message in
render()and send it. -
Keep a view's fields from click to click and across restarts.
-
Let one handler serve many buttons, each carrying its own value.
-
Draw more than text and buttons: menus, images and files.
-
Answer within Discord's three seconds, even when the work takes longer, and answer a click that failed.
-
Hand your database to a handler, and choose how long each dependency lives.
Keep its state¶
-
Read a database row on every click instead of saving it.
-
See what you can do when a view runs out of room in its message.
-
Move a view into a store, with room to grow and a lifetime.
Fit it into your bot¶
-
See which changes break the buttons already sent, and every way to deal with one that does.
-
Run more than one process, and handle two clicks that race.
-
Write six methods against what you already run, and test them with
verify_store.