README.md in slack-smart-bot-1.14.0 vs README.md in slack-smart-bot-1.14.1
- old
+ new
@@ -229,49 +229,31 @@
**_`NAME_OF_BOT THE_COMMAND`_**
To run a command on demand and add the response on a thread:
**_`^THE_COMMAND`_**
**_`!!THE_COMMAND`_**
-Examples run a command on demand:
->**_Peter>_** `!ruby puts Time.now`
->**_Smart-Bot>_** `2019-10-23 12:43:42 +0000`
+Examples run a command on demand:
->**_Peter>_** `@smart-bot echo Example`
->**_Smart-Bot>_** `Example`
+<img src="img/commands_on_demand.png" width="400">
->**_Peter>_** `smart-bot see shortcuts`
->**_Smart-Bot>_** `Available shortcuts for Peter:`
->`Spanish account: ruby require 'iso/iban'; 10.times {puts ISO::IBAN.random('ES')}`
->**_Peter>_** `!!echo Example`
->. . . . . . . . .**_Smart-Bot>_** `Example`
->**_Peter>_** `^echo Example`
->. . . . . . . . .**_Smart-Bot>_** `Example`
Also you can always call the Smart Bot from any channel, even from channels without a running Smart Bot. You can use the External Call on Demand: **_`@NAME_OF_BOT on #CHANNEL_NAME COMMAND`_**. In this case you will call the bot on #CHANNEL_NAME. You can supply more than one channel then all the bots will respond. In case you are in a private conversation with the Smart Bot (DM) then you can use directly: **_`#CHANNEL_NAME COMMAND`_** or **_`on #CHANNEL_NAME COMMAND`_**
-Examples:
->**_Peter>_** `@smart-bot on #the_channel ruby puts Time.now`
->**_Smart-Bot>_** `2019-10-23 12:43:42 +0000`
->**_Peter>_** `@smart-bot on #the_channel ^ruby puts Time.now`
->. . . . . . . . .**_Smart-Bot>_** `2019-10-23 12:43:42 +0000`
+Examples:
+<img src="img/commands_on_external_call.png" width="400">
+
Examples on DM:
>**_Peter>_** `#sales show report from India`
>**_Peter>_** `on #sales notify clients`
If you want the Smart Bot just listen to part of the message you send, add the commands you want using '`' and start the line with '-!', '-!!' or '-^'
-Examples:
->**_Peter>_** ``-!This text won't be treated but this one yes `ruby puts 'a'` and also this one `ruby puts 'b'` ``
->**_Smart-Bot>_** `a`
->**_Smart-Bot>_** `b`
+Examples:
+<img src="img/commands_inline.png" width="400">
->**_Peter>_** ``-^This text won't be treated but this one yes `ruby puts 'a'` and also this one `ruby puts 'b'` ``
->. . . . . . . . .**_Smart-Bot>_** `a`
->. . . . . . . . .**_Smart-Bot>_** `b`
-
All the commands specified on `./rules/general_commands.rb` will be accessible from any channel where the Smart Bot is present, without the necessity to call it with !, !!, ^ or on demand.
Examples:
>**_Peter>_** `Thanks smartbot`
>**_Smart-Bot>_** `You're very welcome`
@@ -285,15 +267,14 @@
To show only the specific rules of the Smart Bot defined on the rules file: **_`bot rules`_** or **_`bot rules COMMAND`_**
Also you can call `suggest command` or `random command` and SmartBot will return the help content for a random command.
-Example:
->**_Peter>_** `bot help echo`
->**_Smart-Bot>_** `echo SOMETHING`
- `repeats SOMETHING`
+Example:
+<img src="img/command_bot_help_echo.png" width="300">
+
When you call a command that is not recognized, you will get suggestions from the Smart Bot.
Remember when you add code to your rules you need to specify the help that will be displayed when using `bot help`, `bot rules`
For the examples use _ and for the rules `. This is a good example of a Help supplied on rules source code:
@@ -366,14 +347,14 @@
### Running Ruby code on a conversation
> for all users
You can run Ruby code by using the command: **_`ruby THE_CODE`_**.
-Example:
->**_Peter>_** `!ruby require 'json'; res=[]; 20.times {res.push rand(100)}; my_json={result: res}; puts my_json.to_json`
->**_Smart-Bot>_** `{"result":[63,66,35,83,44,40,72,25,59,73,75,54,56,91,19,6,68,1,25,3]}`
+Example:
+<img src="img/command_ruby.png" width="500">
+
Also it is possible to attach a Ruby file and the Smart Bot will run and post the output. You need to select Ruby as file format. Or if you prefer it you can call the `ruby` command and on the same message supply a code block.
#### REPL
> for all users
@@ -404,33 +385,21 @@
_repl delete\_logs_
_private repl random-ssn_
_repl_
-Running Example:
->**_Peter>_** `!repl Create10RandomUsers: "This is just an example"`
->**_Smart-Bot>_** `Session name: *Create10RandomUsers*`
->**_Peter>_** `http = NiceHttp.new("https://reqres.in/")`
->**_Smart-Bot>_** `#<NiceHttp:0x00007fc6e216e328 @host="reqres.in", @port=443...>`
->**_Peter>_** `request ||= { path: '/api/users' }`
->**_Smart-Bot>_** `{ :path => "/api/users" }`
->**_Peter>_** `request.data = { name: '1-10:L', job: 'leader|worker' }`
->**_Smart-Bot>_** `{ :name => "1-10:L", :job => "leader|worker" }`
->**_Peter>_** `request.data.generate`
->**_Smart-Bot>_** `{ :name => "kLam", :job => "leader" }`
->**_Peter>_** `10.times { http.post(request.generate) } `
->**_Smart-Bot>_** `10`
->**_Peter>_** `puts "10 Random Users Created"`
->**_Smart-Bot>_** `10 Random Users Created`
->**_Peter>_** `quit`
->**_Smart-Bot>_** `REPL session finished: Create10RandomUsers`
+Running Example:
+<img src="img/command_repl1.png" width="600">
+<img src="img/command_repl2.png" width="600">
->**_Peter>_** `run repl Create10RandomUsers`
->**_Smart-Bot>_** `Running REPL Create10RandomUsers`
->**_Smart-Bot>_** `Create10RandomUsers: 10 Random Users Created`
+Runnning on demand the repl we created:
+
+<img src="img/command_run_repl.png" width="400">
+
+
You can run repls and supply parameters to the repl that will be executed on the same session just before the repl. [More info](https://github.com/MarioRuiz/slack-smart-bot/issues/60)
Example:
>**_Peter>_** ``run repl Create10RandomUsers `request = {path: '/api-dev/users/'}` ``
If you want to add a collaborator while you are on a repl call `add collaborator @USER`. From that moment that user will be able to interact with the repl. You can add all the collaborators you want. When any collaborator wants to jump off the repl, that user can use the `quit` command.
@@ -454,18 +423,16 @@
If you have for example a rule like this: **_`run tests on customers android app`_** and you want to add a shortcut: **_`add shortcut run tca: run tests on customers android app`_**
From that moment you will be able to run the command: **_`run tca`_**
That shortcut will be available for you, in case you want to make it available for everybody on the channel:
-Example:
->**_Peter>_** `!add shortcut for all spanish bank account: ruby require 'iso/iban'; 3.times {puts ISO::IBAN.random('ES')}`
->**_Smart-Bot>_** `shortcut added`
->**_John>_** `!spanish bank account`
->**_Smart-Bot>_** `ES4664553191352006861448`
-`ES4799209592433480943244`
-`ES8888795057132445752702`
+Example:
+
+<img src="img/command_add_sc.png" width="500">
+
+
In case you want to use a shortcut as a inline shortcut inside a command you can do it by adding a $:
Example:
>**_Peter>_** `!add shortcut cust1: 3488823-1233`
>**_Smart-Bot>_** `shortcut added`
>**_Peter>_** `!add shortcut cust2: 1111555-6688`
@@ -489,12 +456,14 @@
>**_Peter>_** `add red message Customers db is down :x:`
>**_Peter>_** `add yellow statement Don't access the linux server without VPN`
>**_Peter>_** `add announcement Party will start at 20:00 :tada:`
>**_Peter>_** `add :heavy_exclamation_mark: message Pay attention all DB are on maintenance until 20:00 GMT`
-To see the announcements of the channel: **_`see announcements`_**, **_`see COLOR announcements`_**, **_`see EMOJI announcements`_** and to delete a particular announcement: **_`delete announcement ID`_**
+To see the announcements of the channel: **_`see announcements`_**, **_`see COLOR announcements`_**, **_`see EMOJI announcements`_** and to delete a particular announcement: **_`delete announcement ID`_**
+<img src="img/command_see_announcements.png" width="500">
+
If you are a master admin and you are on master channel then you can call **_`publish announcements`_** that will publish the announcements on all channels. The messages stored on a DM won't be published. This is very convenient to be called from a *Routine* for example every weekday at 09:00.
### Share messages
> for all users
@@ -519,12 +488,14 @@
>**_Peter>_** `see statuses`
>**_Peter>_** `who is on vacation?`
>**_Peter>_** `who is not on vacation?`
>**_Peter>_** `who is on vacation? #SalesChannel`
>**_Peter>_** `who is on :working-from-home:`
->**_Peter>_** `who is available?`
+>**_Peter>_** `who is available?`
+<img src="img/command_see_statuses.png" width="400">
+
### Routines
> for admins
To add specific commands to be run automatically every certain amount of time or a specific time: **_`add routine NAME every NUMBER PERIOD COMMAND`_** or **_`add routine NAME at TIME COMMAND`_**. Also just before the command you can supply the channel where you want to publish the results, if not channel supplied then it would be the SmartBot Channel or on the DM if the command is run from there. Remember the SmartBot needs to have access to the channel where you want to publish.
@@ -554,11 +525,11 @@
* **_`see result routine NAME`_**
### Loops
> for all users
-You can run any command or rule on a loop by using:
+You can run *any command* or rule on a loop by using:
**_`for NUMBER times every NUMBER minutes COMMAND`_**
**_`for NUMBER times every NUMBER seconds COMMAND`_**
Maximum number of times to be used: 24. Minimum every 10 seconds. Maximum every 60 minutes.
To stop the execution of a loop you can use: **_`quit loop LOOP_ID`_**
@@ -567,10 +538,12 @@
>**_`10 times every 30s !ruby puts Time.now`_**
>**_`24 times every 60m !get sales today`_**
>**_`quit loop 1`_**
>**_`stop iterator 12`_**
+<img src="img/command_loop.png" width="400">
+
### Control who has access to a command
> for admins
You can add, remove and list admins of any channel by using: `add admin @user`, `remove admin @user` and `see admins`. You need to be the creator of the channel, a Master admin or an admin.
@@ -701,12 +674,16 @@
>**_`see all memos from Sales team`_**
>**_`see bugs from Sales team dev`_**
>**_`sales team memo 4 Put it on hold until tests for Apple feature are finished`_**
>**_`sales team memo 7`_**
+<img src="img/command_see_team.png" width="600">
+
+
Other team commands: **_`delete team TEAM_NAME`_**, **_`delete memo ID from team TEAM_NAME`_**, **_`set STATUS on memo ID TEAM_NAME team`_**, **_`see MEMO_TYPE from TEAM_NAME team TOPIC`_**
+
### Time off management
> for all users
You will be able to add or remove vacation and sick periods by using `add vacation/sick from YYYY/MM/DD to YYYY/MM/DD`. The SmartBot will automatically set the users status to 🌴 or 🤒 and the expiration date when the user is on vacation or sick. The SmartBot won't be allowed to change the status of workspace admins or owners.
@@ -734,10 +711,10 @@
}
```
When calling `see my time off` on a DM will display a calendar of the year with the days off, including public holidays
-<img src="img/my_timeoff.png" width="650">
+<img src="img/command_my_timeoff.png" width="650">
Other 'time off' commands: **_`remove time off ID`_**, **_`see my time off`_**, **_`see vacations @USER`_**, **_`time off team NAME`_**, **_`set public holidays to COUNTRY/REGION`_**
### OpenAI