slack-smart-bot 1.14.1 → 1.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -12
- data/lib/slack/smart-bot/commands/general/bot_help.rb +1 -0
- data/lib/slack/smart-bot/commands/general_bot_commands.rb +5 -0
- data/lib/slack/smart-bot/commands/on_bot/add_shortcut.rb +1 -0
- data/lib/slack/smart-bot/commands/on_bot/admin/add_routine.rb +1 -0
- data/lib/slack/smart-bot/commands/on_bot/repl.rb +1 -0
- data/lib/slack/smart-bot/commands/on_extended/bot_rules.rb +1 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bab245674cac897b9bc248f749a80b8d83c0654bb8abdaa1ca985211995df834
|
4
|
+
data.tar.gz: c22b08d76ee508e7f7a1f5a5a294722ff0cf10e5ddb7a88fdcfca2ac05489510
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d89f157f6e1cc1ebe762eef538b427c33610d18aeb47a0383cf17e8a18c18f7498a523bef74b4a1b8e61b455e60407fe5169ecafb0810aec813011c1b4d63f6c
|
7
|
+
data.tar.gz: 3d3eeab66e48f7289bb9dc194e38f943d95a57447419f6db66afcdea22c24d23c1f6cc9a5b391290c60f35642520e88b6110fcb2a72efdcf4188a9900ceadc92
|
data/README.md
CHANGED
@@ -233,7 +233,7 @@ To run a command on demand and add the response on a thread:
|
|
233
233
|
|
234
234
|
Examples run a command on demand:
|
235
235
|
|
236
|
-
<img src="img/commands_on_demand.png" width="
|
236
|
+
<img src="img/commands_on_demand.png" width="500">
|
237
237
|
|
238
238
|
|
239
239
|
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`_**
|
@@ -249,7 +249,7 @@ Examples on DM:
|
|
249
249
|
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 '-^'
|
250
250
|
|
251
251
|
Examples:
|
252
|
-
<img src="img/commands_inline.png" width="
|
252
|
+
<img src="img/commands_inline.png" width="500">
|
253
253
|
|
254
254
|
|
255
255
|
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.
|
@@ -270,7 +270,7 @@ To show only the specific rules of the Smart Bot defined on the rules file: **_`
|
|
270
270
|
Also you can call `suggest command` or `random command` and SmartBot will return the help content for a random command.
|
271
271
|
|
272
272
|
Example:
|
273
|
-
<img src="img/command_bot_help_echo.png" width="
|
273
|
+
<img src="img/command_bot_help_echo.png" width="250">
|
274
274
|
|
275
275
|
|
276
276
|
When you call a command that is not recognized, you will get suggestions from the Smart Bot.
|
@@ -350,7 +350,7 @@ Also you can always call the Smart Bot from any channel, even from channels with
|
|
350
350
|
You can run Ruby code by using the command: **_`ruby THE_CODE`_**.
|
351
351
|
|
352
352
|
Example:
|
353
|
-
<img src="img/command_ruby.png" width="
|
353
|
+
<img src="img/command_ruby.png" width="650">
|
354
354
|
|
355
355
|
|
356
356
|
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.
|
@@ -358,6 +358,8 @@ Also it is possible to attach a Ruby file and the Smart Bot will run and post th
|
|
358
358
|
#### REPL
|
359
359
|
> for all users
|
360
360
|
|
361
|
+
[![SmartBot REPLs](https://img.youtube.com/vi/URMI3BdD7J8/0.jpg)](https://www.youtube.com/watch?v=URMI3BdD7J8)
|
362
|
+
|
361
363
|
Easily starts a REPL session so you will be able to create a script directly from the slack conversation. You will be able to share the REPL so they can run it or see the content.
|
362
364
|
|
363
365
|
It Will run all we write as a ruby command and will keep the session values until we finish the session sending `quit`, `exit` or `bye`
|
@@ -388,9 +390,9 @@ Examples:
|
|
388
390
|
|
389
391
|
|
390
392
|
Running Example:
|
391
|
-
<img src="img/command_repl1.png" width="
|
393
|
+
<img src="img/command_repl1.png" width="650">
|
392
394
|
|
393
|
-
<img src="img/command_repl2.png" width="
|
395
|
+
<img src="img/command_repl2.png" width="650">
|
394
396
|
|
395
397
|
|
396
398
|
Runnning on demand the repl we created:
|
@@ -428,7 +430,7 @@ That shortcut will be available for you, in case you want to make it available f
|
|
428
430
|
|
429
431
|
Example:
|
430
432
|
|
431
|
-
<img src="img/command_add_sc.png" width="
|
433
|
+
<img src="img/command_add_sc.png" width="650">
|
432
434
|
|
433
435
|
|
434
436
|
In case you want to use a shortcut as a inline shortcut inside a command you can do it by adding a $:
|
@@ -460,7 +462,7 @@ Examples:
|
|
460
462
|
|
461
463
|
To see the announcements of the channel: **_`see announcements`_**, **_`see COLOR announcements`_**, **_`see EMOJI announcements`_** and to delete a particular announcement: **_`delete announcement ID`_**
|
462
464
|
|
463
|
-
<img src="img/command_see_announcements.png" width="
|
465
|
+
<img src="img/command_see_announcements.png" width="650">
|
464
466
|
|
465
467
|
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.
|
466
468
|
|
@@ -540,7 +542,7 @@ Examples:
|
|
540
542
|
>**_`quit loop 1`_**
|
541
543
|
>**_`stop iterator 12`_**
|
542
544
|
|
543
|
-
<img src="img/command_loop.png" width="
|
545
|
+
<img src="img/command_loop.png" width="500">
|
544
546
|
|
545
547
|
### Control who has access to a command
|
546
548
|
> for admins
|
@@ -619,6 +621,8 @@ Examples:
|
|
619
621
|
### Teams
|
620
622
|
> for all users
|
621
623
|
|
624
|
+
[![SmartBot Teams](https://img.youtube.com/vi/u8B4aGDXH9M/0.jpg)](https://www.youtube.com/watch?v=u8B4aGDXH9M)
|
625
|
+
|
622
626
|
You can add, update, see, ping and delete teams. When calling `see TEAM_NAME team` the availability of the members will be displayed.
|
623
627
|
`add team TEAM_NAME PROPERTIES` will add a team with the info supplied. In case it is supplied a channel with type 'members' the members of that channel would be considered members of the team.
|
624
628
|
|
@@ -676,7 +680,7 @@ Examples:
|
|
676
680
|
>**_`sales team memo 4 Put it on hold until tests for Apple feature are finished`_**
|
677
681
|
>**_`sales team memo 7`_**
|
678
682
|
|
679
|
-
<img src="img/command_see_team.png" width="
|
683
|
+
<img src="img/command_see_team.png" width="650">
|
680
684
|
|
681
685
|
|
682
686
|
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`_**
|
@@ -713,7 +717,7 @@ settings = {
|
|
713
717
|
|
714
718
|
When calling `see my time off` on a DM will display a calendar of the year with the days off, including public holidays
|
715
719
|
|
716
|
-
<img src="img/command_my_timeoff.png" width="
|
720
|
+
<img src="img/command_my_timeoff.png" width="750">
|
717
721
|
|
718
722
|
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`_**
|
719
723
|
|
@@ -731,7 +735,7 @@ ai: {
|
|
731
735
|
access_token: 'OPENAI_ACCESS_TOKEN',
|
732
736
|
organization_id: 'OPENAI_ORGANIZATION_ID',
|
733
737
|
gpt_model: 'gpt-3.5-turbo',
|
734
|
-
whisper_model
|
738
|
+
whisper_model: 'whisper-1',
|
735
739
|
image_size: '256x256'
|
736
740
|
}
|
737
741
|
}
|
@@ -116,6 +116,7 @@ class SlackSmartBot
|
|
116
116
|
end
|
117
117
|
output.each do |h|
|
118
118
|
msg = h.gsub(/^\s*command_id:\s+:\w+\s*$/,'')
|
119
|
+
msg.gsub!(/^\s*>.+$/,'') if help_command.to_s != ''
|
119
120
|
unless msg.match?(/\A\s*\z/)
|
120
121
|
respond msg, dest, unfurl_links: false, unfurl_media: false
|
121
122
|
end
|
@@ -86,6 +86,7 @@ class SlackSmartBot
|
|
86
86
|
bye_bot(dest, user.name, display_name)
|
87
87
|
|
88
88
|
# help: ----------------------------------------------
|
89
|
+
# help: >*<https://github.com/MarioRuiz/slack-smart-bot#announcements|ANNOUNCEMENTS>*
|
89
90
|
# help: `add announcement MESSAGE`
|
90
91
|
# help: `add red announcement MESSAGE`
|
91
92
|
# help: `add green announcement MESSAGE`
|
@@ -162,6 +163,7 @@ class SlackSmartBot
|
|
162
163
|
|
163
164
|
|
164
165
|
# help: ----------------------------------------------
|
166
|
+
# help: >*<https://github.com/MarioRuiz/slack-smart-bot#share-messages|SHARE MESSAGES>*
|
165
167
|
# help: `share messages /REGEXP/ on #CHANNEL`
|
166
168
|
# help: `share messages "TEXT" on #CHANNEL`
|
167
169
|
# xhelp: `share messages :EMOJI: on #CHANNEL`
|
@@ -395,6 +397,7 @@ class SlackSmartBot
|
|
395
397
|
end
|
396
398
|
|
397
399
|
# help: ----------------------------------------------
|
400
|
+
# help: >*<https://github.com/MarioRuiz/slack-smart-bot#teams|TEAMS>*
|
398
401
|
# help: `add team TEAM_NAME members #TEAM_CHANNEL CHANNEL_TYPE #CHANNEL1 #CHANNEL99 : INFO`
|
399
402
|
# help: `add team TEAM_NAME MEMBER_TYPE @USER1 @USER99 CHANNEL_TYPE #CHANNEL1 #CHANNEL99 : INFO`
|
400
403
|
# help: `add team TEAM_NAME MEMBER_TYPE1 @USER1 @USER99 MEMBER_TYPE99 @USER1 @USER99 CHANNEL_TYPE1 #CHANNEL1 #CHANNEL99 CHANNEL_TYPE99 #CHANNEL1 #CHANNEL99 : INFO`
|
@@ -662,6 +665,7 @@ class SlackSmartBot
|
|
662
665
|
see_memos_team(user, type: type, name: name, topic: topic)
|
663
666
|
|
664
667
|
# help: ----------------------------------------------
|
668
|
+
# help: >*<https://github.com/MarioRuiz/slack-smart-bot#time-off-management|TIME OFF MANAGEMENT>*
|
665
669
|
# help: `add vacation from YYYY/MM/DD to YYYY/MM/DD`
|
666
670
|
# help: `add vacation YYYY/MM/DD`
|
667
671
|
# help: `add sick from YYYY/MM/DD to YYYY/MM/DD`
|
@@ -826,6 +830,7 @@ class SlackSmartBot
|
|
826
830
|
personal_settings(user, settings_type, settings_id, settings_value)
|
827
831
|
|
828
832
|
# help: ----------------------------------------------
|
833
|
+
# help: >*<https://github.com/MarioRuiz/slack-smart-bot#openai|OpenAI>*
|
829
834
|
# help: `?w`
|
830
835
|
# help: `?w PROMPT`
|
831
836
|
# help: OpenAI: It will transcribe the audio file attached and performed the PROMPT indicated if supplied.
|
@@ -1,6 +1,7 @@
|
|
1
1
|
class SlackSmartBot
|
2
2
|
|
3
3
|
# help: ----------------------------------------------
|
4
|
+
# help: >*<https://github.com/MarioRuiz/slack-smart-bot#shortcuts|SHORTCUTS>*
|
4
5
|
# help: `add shortcut NAME: COMMAND`
|
5
6
|
# help: `add sc NAME: COMMAND`
|
6
7
|
# help: `add shortcut for all NAME: COMMAND`
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class SlackSmartBot
|
2
2
|
# helpadmin: ----------------------------------------------
|
3
|
+
# helpadmin: >*<https://github.com/MarioRuiz/slack-smart-bot#routines|ROUTINES>*
|
3
4
|
# helpadmin: `add routine NAME every NUMBER PERIOD COMMAND`
|
4
5
|
# helpadmin: `add routine NAME every NUMBER PERIOD #CHANNEL COMMAND`
|
5
6
|
# helpadmin: `add routine NAME every NUMBER PERIOD`
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-smart-bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.14.
|
4
|
+
version: 1.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Ruiz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slack-ruby-client
|
@@ -65,6 +65,9 @@ dependencies:
|
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '3'
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 3.7.0
|
68
71
|
type: :runtime
|
69
72
|
prerelease: false
|
70
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -72,6 +75,9 @@ dependencies:
|
|
72
75
|
- - "~>"
|
73
76
|
- !ruby/object:Gem::Version
|
74
77
|
version: '3'
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 3.7.0
|
75
81
|
- !ruby/object:Gem::Dependency
|
76
82
|
name: nice_hash
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|