Skip to content

Commit 9b91da7

Browse files
committed
BEACON-6 add documentation for up-arrow functionality
1 parent f6ce079 commit 9b91da7

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

content/docs/components/actions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ actions: {
3737
method: (props: {
3838
dispatch: Dispatch,
3939
character: Character,
40+
actionId?: string,
4041
messageId?: string,
4142
rolls?: RollResults
4243
}, ...args: string[]): void | Promise<void>
@@ -50,6 +51,7 @@ The action's `method` receives a `props` object from the host containing the fol
5051
5152
- `dispatch`: A `Dispatch` object.
5253
- `character`: The data of the character performing the action. Currently, the action will not receive the character’s bio or GM notes, regardless of whether the player has access to those fields.
54+
- `actionId` (optional): A unique ID for the action. If this id is provided to a `post` or `postRaw` call, the action will be added to the chat's action history and will be filled in the chat box when the user presses the up arrow key.
5355
- `messageId` (optional): A unique ID for an existing chat message. It's included in actions triggered from chat buttons to provide context for the original roll.
5456
- `rolls` (optional): Included when action is triggered from a chat button. Contains the roll results of the original roll.
5557

content/docs/components/dispatch.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ The method returns a promise that resolves with an object containing the message
6363
dispatch.post({
6464
characterId: string,
6565
messageId?: string,
66+
actionId?: string,
6667
content: string,
6768
options?: {
6869
whisper?: 'gm',
@@ -78,11 +79,14 @@ The secret option is ignored unless whisper is also set, toggling to true will c
7879

7980
Like roll, messageId can be provided to update an existing chat message, but if omitted the method will generate a new messageId and post a new chat message. The method returns the messageId.
8081

82+
Post can also accept an actionId. When provided a valid actionId from a triggered action, that action's signature will be added to the chat's action history and will be filled in the chat box when the user presses the up arrow key.
83+
8184
#### postRaw
8285
```javascript
8386
dispatch.postRaw({
8487
characterId: string,
8588
messageId?: string,
89+
actionId?: string,
8690
content: string,
8791
options?: {
8892
whisper?: 'gm',

content/docs/components/roll.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ dispatch.post({
5454
})
5555
```
5656

57+
## Adding to Chat History (Up-Arrow)
58+
In order to provide support for adding a roll to the chat history, the roll must have originated from an [action](/beacon-docs/docs/components/actions). Actions provide a string argument, `actionId`, which must be provided in the `post` method when the roll is posted to chat. When the user presses the up arrow key, the chat input will be filled with a macro for this action including any provided arguments.
59+
5760
## Additional Roll Posting Options
5861

5962
## data-rollname

0 commit comments

Comments
 (0)