You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ChatBots.md
+22-21Lines changed: 22 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ class Kernel extends ConsoleKernel
73
73
74
74
- 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].
75
75
- 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.
77
77
- Please see the [Events Documentation][link-events-docs] for more information.
78
78
79
79
---
@@ -139,12 +139,12 @@ class TestBot extends BotActionHandler
139
139
140
140
**`unique`, `match`, and `triggers` are optional overrides.**
141
141
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.
148
148
149
149
---
150
150
@@ -507,13 +507,13 @@ class TestBotPackage extends PackagedBot
507
507
508
508
**`avatar`, `cooldown`, `enabled`, and `hide_actions` are optional overrides.**
509
509
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`.
517
517
518
518
**Example:**
519
519
@@ -541,13 +541,14 @@ public static function getSettings(): array
541
541
- Return the listing of `BotActionHandler` classes you want to be bundled with this install.
542
542
- The array keys must be the `BotActionHandler` class.
543
543
- 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.
-`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.
551
552
- 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.
Copy file name to clipboardExpand all lines: docs/Configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
#### SET THIS BEFORE MIGRATING
14
14
15
15
- 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.
17
17
- This also determines the primary key type on the internal `Bot` model and its related columns.
- 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.
14
14
- You will be asked to confirm running this command, as well as an option to run the migrations before completion.
15
15
- 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.
16
16
```bash
@@ -36,8 +36,7 @@ php artisan migrate
36
36
- Providers are the model's from your application you register into `Messenger`.
37
37
- For most applications, you will only register your `User` model.
38
38
- 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.
0 commit comments