Command
The actual help command, to start the magic.
Lets start right here, at the help command comment..
Remove the comment, as we'll start writing a few things here now. First, lets specify an object with some settings for the reaction help:
Let me explain these..
limit
is how long you want to wait for a reaction before timing out completely. Here, we've set it to 15 seconds, a reasonable time.min
is the minimum page, aka. the lowest you can go.max
is the maximum page, aka. the highest you can go, usually the last page.Both min and max are used to set the limits for the user, so errors won't occur.
page
is the page to start the help on, and should probably be left as1
.
Now, we can add some basic code to send an embed, and add the reactions:
Here, we're sending the first page, and adding the back, forward and delete reactions (those are, in Discord, :arrow_left:
, :arrow_right:
and :wastebasket:)
.
For watchful users, we can define pages now. For simplicity, we'll just use an object. Go to where we made the // pages
comment, and replace it with this code:
Now, you have pages, and these will be sent on request.
Finally, to finish the command, add this little bit of code (we'll be coding next) to start listening for reactions:
The filter may look complicated, but all it does is makes sure the reaction received is one we want, and that the person that reacts is who used the help command.
Last updated
Was this helpful?