Skip to content

Commit cf94da1

Browse files
committed
Update documentation.
1 parent 3a51a58 commit cf94da1

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

docs/ChatBots.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Kernel extends ConsoleKernel
7373

7474
- If a [BotActionHandler][link-action-handler] throws an exception while being handled, it will be caught and dispatched in the [BotActionFailedEvent][link-action-failed-event].
7575
- Upon a [BotActionHandler][link-action-handler] being handled successfully, the [BotActionHandledEvent][link-action-handled-event] will be dispatched.
76-
- You must attach your own event listeners to these events if you plan do utilize them.
76+
- You must attach your own event listeners to these events if you plan to utilize them.
7777
- Please see the [Events Documentation][link-events-docs] for more information.
7878

7979
---
@@ -139,12 +139,12 @@ class TestBot extends BotActionHandler
139139

140140
**`unique`, `match`, and `triggers` are optional overrides.**
141141

142-
- `alias` Used to locate and attach your handler to a bot.
143-
- `description` The description of your bot handler, typically what it does.
144-
- `name` The name of your bot handler.
145-
- `unique (optional)` When set and true, the handler may only be used once across all bots in a thread.
146-
- `triggers (optional)` Overrides allowing the end user to set the triggers. Only the given trigger(s) will be used. Separate multiple via the pipe (|) or use an array.
147-
- `match (optional)` Overrides allowing end user to select matching method.
142+
- `alias [string]` Used to locate and attach your handler to a bot.
143+
- `description [string]` The description of your bot handler, typically what it does.
144+
- `name [string]` The name of your bot handler.
145+
- `unique (optional) [bool]` When set and true, the handler may only be used once across all bots in a thread.
146+
- `triggers (optional) [array]` Overrides allowing the end user to set the triggers. Only the given trigger(s) will be used. Use a single array of all trigger words.
147+
- `match (optional) [string]` Overrides allowing end user to select matching method.
148148

149149
---
150150

@@ -507,13 +507,13 @@ class TestBotPackage extends PackagedBot
507507

508508
**`avatar`, `cooldown`, `enabled`, and `hide_actions` are optional overrides.**
509509

510-
- `alias` Used to locate and install your packaged bot.
511-
- `description` The description of your packaged bot.
512-
- `name` The name of your packaged bot. The name will be used as the original `Bot` model's `name` when stored.
513-
- `avatar (optional)` Define the path to a local image file that will be used to display the package's avatar to the frontend, as well as stored for the `Bot` models initial `avatar`.
514-
- `cooldown` Cooldown the `Bot` model stored has after each action is triggered. Default of `0`.
515-
- `enabled` Whether the `Bot` model is enabled or disabled. Default of `true`.
516-
- `hide_actions` Whether the `Bot` model's actions are hidden or visible to others. Default of `false`.
510+
- `alias [string]` Used to locate and install your packaged bot.
511+
- `description [string]` The description of your packaged bot.
512+
- `name [string]` The name of your packaged bot. The name will be used as the original `Bot` model's `name` when stored.
513+
- `avatar (optional) [string]` Define the path to a local image file that will be used to display the package's avatar to the frontend, as well as stored for the `Bot` models initial `avatar`.
514+
- `cooldown (optional) [int]` Cooldown the `Bot` model stored has after each action is triggered. Default of `0`.
515+
- `enabled (optional) [bool]` Whether the `Bot` model is enabled or disabled. Default of `true`.
516+
- `hide_actions (optional) [bool]` Whether the `Bot` model's actions are hidden or visible to others. Default of `false`.
517517

518518
**Example:**
519519

@@ -541,13 +541,14 @@ public static function getSettings(): array
541541
- Return the listing of `BotActionHandler` classes you want to be bundled with this install.
542542
- The array keys must be the `BotActionHandler` class.
543543
- For handlers that require you to set properties, or that you want to override certain defaults, you must define them as the value of the handler class key represented as an associative array.
544-
- If you want the handler to be installed multiple times with different parameters, you can define an array of arrays as the value. The key/values of your parameters must match the default for a BotAction model, as well as include any parameters that are defined on the handlers rules for serializing a payload.
545-
- `BotAction | BotActionHandler` handler keys include:
546-
- `enabled` Default of `true`.
547-
- `cooldown` Default of `30`.
548-
- `admin_only` Default of `false`.
549-
- `triggers` No default. You must define them if the `BotActionHandler` does not override them.
550-
- `match` No default. You must define them if the `BotActionHandler` does not override them.
544+
- If you want the handler to be installed multiple times with different parameters, you can define an array of arrays as the value.
545+
- The key/values of your parameters must match the default for a BotAction model, as well as include any parameters that are defined on the handlers rules for serializing a payload.
546+
- `BotAction | BotActionHandler` keys include:
547+
- `enabled [bool]` Default of `true`.
548+
- `cooldown [int]` Default of `30`.
549+
- `admin_only [bool]` Default of `false`.
550+
- `triggers (optional) [array]` No default. You must define them if the `BotActionHandler` does not override them.
551+
- `match (optional) [string]` No default. You must define them if the `BotActionHandler` does not override them.
551552
- Any parameters that are already defined in the bot handler class cannot be overridden. While installing, each `BotActionHandler` will pass through a validation process, and will be discarded if it fails validating.
552553

553554
---

docs/Configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#### SET THIS BEFORE MIGRATING
1414

1515
- All tables in this package that have relations to one of your `MessengerProvider` models will use polymorphic `morphTo` columns. If your providers use UUIDs (char 36) as their primary keys, then set this to true.
16-
- Please note that if you use multiple providers, they all must have matching primary key types (int / char / etc.).
16+
- Please note that if you use multiple providers, they all must have matching primary key types.
1717
- This also determines the primary key type on the internal `Bot` model and its related columns.
1818

1919
---

docs/Installation.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ composer require rtippin/messenger
99
```
1010

1111
### Install Command
12-
- Installs the base messenger files, publishing the [`messenger.php`][link-config] config and service provider.
13-
- This will also register the published service provider in your `app.php` config file inside the providers array.
12+
- Installs the base messenger files, publishing the [`messenger.php`][link-config] configuration file and `MessengerServiceProvider`.
13+
- This will also register the published service provider in your `app.php` configuration file inside the `providers` array.
1414
- You will be asked to confirm running this command, as well as an option to run the migrations before completion.
1515
- If your `Provider|User` models you are registering in `Messenger` use UUIDs instead of auto-incrementing integers as their primary keys, add the `--uuids` flag when installing.
1616
```bash
@@ -36,8 +36,7 @@ php artisan migrate
3636
- Providers are the model's from your application you register into `Messenger`.
3737
- For most applications, you will only register your `User` model.
3838
- If you had a `User` and a `Teacher` model, you can register both models with `Messenger`, allowing teachers to have their own inbox, and able to message users as a teacher.
39-
- The `Bot` model is a registered internally as a provider, allowing it to participate in group threads.
40-
- Your provider models will also use the internal [Messenger.php][link-messenger-model] model, which acts as a settings model, as well as allowing reverse search. More on this below, after registering providers.
39+
- Your provider models will also use the internal [Messenger.php][link-messenger-model] model, which acts as a settings model, as well as allowing reverse searching. More on this below, after registering providers.
4140
4241
---
4342

0 commit comments

Comments
 (0)