new RichMenu( [embed])
Constructs our RichMenu instance
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
embed |
external:MessageEmbed |
<optional> |
new MessageEmbed() | A Template embed to apply to all pages |
- Since:
-
- 0.4.0
- Source:
- lib/util/RichMenu.js#L63
Extends
Properties
-
embedTemplate :external:MessageEmbed
-
The embed template
Type:
- Since:
-
- 0.4.0
- Inherited From:
- Overrides:
- Source:
- lib/util/RichDisplay.js#L53
-
emojis :RichMenuEmojisObject
-
The default emojis to use for this menu
Type:
- RichMenuEmojisObject
- Since:
-
- 0.4.0
- Overrides:
- Source:
- lib/util/RichMenu.js#L66
-
If footers have been applied to all pages
Type:
- boolean
- Since:
-
- 0.4.0
- Inherited From:
- Overrides:
- Source:
- lib/util/RichDisplay.js#L89
-
<nullable> infoPage :external:MessageEmbed
-
An optional Info page/embed
Type:
- Since:
-
- 0.4.0
- Inherited From:
- Overrides:
- Source:
- lib/util/RichDisplay.js#L67
-
options :Array.<MenuOption>
-
The options of this Menu
Type:
- Array.<MenuOption>
- Since:
-
- 0.4.0
- Source:
- lib/util/RichMenu.js#L97
-
pages :external:MessageEmbed
-
The stored pages of the display
Type:
- Since:
-
- 0.4.0
- Inherited From:
- Overrides:
- Source:
- lib/util/RichDisplay.js#L60
-
paginated :boolean
-
If options have been paginated yet
Type:
- boolean
- Since:
-
- 0.4.0
- Source:
- lib/util/RichMenu.js#L90
-
<readonly> template :external:MessageEmbed
-
A new instance of the template embed
Type:
- Since:
-
- 0.4.0
- Inherited From:
- Overrides:
- Source:
- lib/util/RichDisplay.js#L98
Methods
-
addOption(name, body [, inline])
-
Adds a MenuOption
Parameters:
Name Type Argument Default Description name
string The name of the option body
string The description of the option inline
boolean <optional>
false Whether the option should be inline - Since:
-
- 0.4.0
- Source:
- lib/util/RichMenu.js#L116
Returns:
this RichMenu- Type
- RichMenu
-
addPage()
-
- Since:
-
- 0.4.0
- Overrides:
- Source:
- lib/util/RichMenu.js#L104
Throws:
You cannot directly add pages in a RichMenu -
<async> run(msg, options)
-
Runs this RichMenu
Parameters:
Name Type Description msg
external:Message A message to edit or use to send a new message with options
RichMenuRunOptions The options to use with this RichMenu - Since:
-
- 0.4.0
- Overrides:
- Source:
- lib/util/RichMenu.js#L128
Returns:
- Type
- ReactionHandler
-
setEmojis(emojis)
-
Sets emojis to a new set of emojis
Parameters:
Name Type Description emojis
RichDisplayEmojisObject An object containing replacement emojis to use instead. - Since:
-
- 0.4.0
- Inherited From:
- Overrides:
- Source:
- lib/util/RichDisplay.js#L108
Returns:
this RichDisplay- Type
- RichDisplay
-
setInfoPage(embed)
-
Adds an info page to the RichDisplay
Parameters:
Name Type Description embed
function | external:MessageEmbed A callback with the embed template passed and the embed returned, or an embed. - Since:
-
- 0.4.0
- Inherited From:
- Overrides:
- Source:
- lib/util/RichDisplay.js#L130
Returns:
this RichDisplay- Type
- RichDisplay
Type Definitions
-
emoji
-
A single unicode character
Type:
- string
- Source:
- lib/util/RichMenu.js#L9
-
MenuOption
-
Type:
- object
- Source:
- lib/util/RichMenu.js#L37
Properties:
Name Type Argument Default Description name
string The name of the option body
string The description of the option inline
boolean <optional>
false Whether the option should be inline -
ReactionHandlerOptions
-
Type:
- object
- Source:
- lib/util/ReactionHandler.js#L16
Properties:
Name Type Argument Default Description filter
function <optional>
A filter function to add to the ReactionHandler stop
boolean <optional>
true If a stop reaction should be included prompt
string <optional>
'Which page would you like to jump to?' The prompt to be used when awaiting user input on a page to jump to startPage
number <optional>
0 The page to start the RichMenu on max
number <optional>
The maximum total amount of reactions to collect maxEmojis
number <optional>
The maximum number of emojis to collect maxUsers
number <optional>
The maximum number of users to react time
number <optional>
The maximum amount of time before this RichMenu should expire -
RichMenuEmojisObject
-
Type:
- object
- Source:
- lib/util/RichMenu.js#L15
Properties:
Name Type Description first
emoji back
emoji forward
emoji last
emoji jump
emoji info
emoji stop
emoji zero
emoji one
emoji two
emoji three
emoji four
emoji five
emoji six
emoji seven
emoji eight
emoji nine
emoji -
RichMenuRunOptions
-
Type:
- object
- Source:
- lib/util/RichMenu.js#L45
Properties:
Name Type Argument Default Description filter
function <optional>
A filter function to add to the ReactionHandler (Recieves: Reaction, User) stop
boolean <optional>
true If a stop reaction should be included prompt
string <optional>
'Which page would you like to jump to?' The prompt to be used when awaiting user input on a page to jump to startPage
number <optional>
0 The page to start the RichMenu on max
number <optional>
The maximum total amount of reactions to collect maxEmojis
number <optional>
The maximum number of emojis to collect maxUsers
number <optional>
The maximum number of users to react time
number <optional>
The maximum amount of time before this RichMenu should expire