Skip to content

Commit

Permalink
docs(bots): Update documentation for bots
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Feb 11, 2025
1 parent d7fd14b commit 21d46de
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 26 deletions.
192 changes: 170 additions & 22 deletions docs/bots.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions docs/constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@
* `1` Enabled
* `2` No setup - The bot can neither be enabled nor disabled by a moderator

### Bot features
* `0` (none) - Bot is not functional at the moment
* `1` (webhook) - Bot is receive webhooks
* `2` (response) - Bot is sending webhooks
* `4` (event) - Bot is invoked via PHP event `OCA\Talk\Events\BotInvokeEvent`
* `8` (reaction) - Bot is receiving webhooks or is invoked via PHP event for adding and removing reactions

## Signaling modes
* `internal` - No external signaling server is used
* `external` - A single external signaling server is used
Expand Down
4 changes: 2 additions & 2 deletions docs/occ.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Install a new bot on the server
|---|---|---|---|---|---|
| `--output` | Output format (plain, json or json_pretty, default is plain) | yes | no | no | `'plain'` |
| `--no-setup` | Prevent moderators from setting up the bot in a conversation | no | no | no | `false` |
| `--feature\|-f` | Specify the list of features for the bot - webhook: The bot receives posted chat messages as webhooks - response: The bot can post messages and reactions as a response - event: The bot reads posted messages from local events - none: When all features should be disabled for the bot | yes | yes | yes | *Required* |
| `--feature\|-f` | Specify the list of features for the bot - webhook: The bot receives posted chat messages as webhooks - response: The bot can post messages and reactions as a response - event: The bot reads posted messages from local events - reaction: The bot is notified about adding and removing of reactions - none: When all features should be disabled for the bot | yes | yes | yes | *Required* |

## talk:bot:list

Expand Down Expand Up @@ -70,7 +70,7 @@ Change the state or feature list for a bot
| Options | Description | Accept value | Is value required | Is multiple | Default |
|---|---|---|---|---|---|
| `--output` | Output format (plain, json or json_pretty, default is plain) | yes | no | no | `'plain'` |
| `--feature\|-f` | Specify the list of features for the bot - webhook: The bot receives posted chat messages as webhooks - response: The bot can post messages and reactions as a response - none: When all features should be disabled for the bot | yes | yes | yes | *Required* |
| `--feature\|-f` | Specify the list of features for the bot - webhook: The bot receives posted chat messages as webhooks - response: The bot can post messages and reactions as a response - event: The bot reads posted messages from local events - reaction: The bot is notified about adding and removing of reactions - none: When all features should be disabled for the bot | yes | yes | yes | *Required* |

## talk:bot:setup

Expand Down
1 change: 1 addition & 0 deletions lib/Command/Bot/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ protected function configure(): void {
. ' - webhook: The bot receives posted chat messages as webhooks' . "\n"
. ' - response: The bot can post messages and reactions as a response' . "\n"
. ' - event: The bot reads posted messages from local events' . "\n"
. ' - reaction: The bot is notified about adding and removing of reactions' . "\n"
. ' - none: When all features should be disabled for the bot'
)
;
Expand Down
2 changes: 2 additions & 0 deletions lib/Command/Bot/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ protected function configure(): void {
'Specify the list of features for the bot' . "\n"
. ' - webhook: The bot receives posted chat messages as webhooks' . "\n"
. ' - response: The bot can post messages and reactions as a response' . "\n"
. ' - event: The bot reads posted messages from local events' . "\n"
. ' - reaction: The bot is notified about adding and removing of reactions' . "\n"
. ' - none: When all features should be disabled for the bot'
)
;
Expand Down
4 changes: 2 additions & 2 deletions lib/Events/BotInvokeEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
* type: 'Person',
* id: non-empty-string,
* name: non-empty-string,
* talkParticipantType: numeric-string,
* talkParticipantType?: numeric-string,
* },
* object: array{
* type: 'Note',
Expand All @@ -77,7 +77,7 @@
* type: 'Person',
* id: non-empty-string,
* name: non-empty-string,
* talkParticipantType: numeric-string,
* talkParticipantType?: numeric-string,
* },
* object: ReactionMessageData,
* target: array{
Expand Down

0 comments on commit 21d46de

Please sign in to comment.