slack-ruby-client-bhe 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +17 -0
  2. data/.gitignore +4 -0
  3. data/.gitmodules +3 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +6 -0
  6. data/.rubocop_todo.yml +78 -0
  7. data/.travis.yml +26 -0
  8. data/CHANGELOG.md +79 -0
  9. data/CONTRIBUTING.md +157 -0
  10. data/Gemfile +5 -0
  11. data/LICENSE.md +22 -0
  12. data/README.md +385 -0
  13. data/RELEASING.md +69 -0
  14. data/Rakefile +19 -0
  15. data/UPGRADING.md +26 -0
  16. data/bin/commands.rb +21 -0
  17. data/bin/commands/api.rb +14 -0
  18. data/bin/commands/auth.rb +12 -0
  19. data/bin/commands/channels.rb +149 -0
  20. data/bin/commands/chat.rb +47 -0
  21. data/bin/commands/dnd.rb +47 -0
  22. data/bin/commands/emoji.rb +12 -0
  23. data/bin/commands/files.rb +72 -0
  24. data/bin/commands/groups.rb +167 -0
  25. data/bin/commands/im.rb +53 -0
  26. data/bin/commands/mpim.rb +53 -0
  27. data/bin/commands/oauth.rb +16 -0
  28. data/bin/commands/pins.rb +37 -0
  29. data/bin/commands/reactions.rb +53 -0
  30. data/bin/commands/rtm.rb +15 -0
  31. data/bin/commands/search.rb +40 -0
  32. data/bin/commands/stars.rb +37 -0
  33. data/bin/commands/team.rb +32 -0
  34. data/bin/commands/usergroups.rb +73 -0
  35. data/bin/commands/users.rb +57 -0
  36. data/bin/slack +50 -0
  37. data/examples/hi_real_time/Gemfile +5 -0
  38. data/examples/hi_real_time/hi.gif +0 -0
  39. data/examples/hi_real_time/hi.rb +32 -0
  40. data/examples/hi_real_time_and_web/Gemfile +5 -0
  41. data/examples/hi_real_time_and_web/hi.gif +0 -0
  42. data/examples/hi_real_time_and_web/hi.rb +24 -0
  43. data/examples/hi_real_time_async/Gemfile +5 -0
  44. data/examples/hi_real_time_async/hi.rb +29 -0
  45. data/examples/hi_web/Gemfile +3 -0
  46. data/examples/hi_web/hi.gif +0 -0
  47. data/examples/hi_web/hi.rb +12 -0
  48. data/examples/new_ticket/Gemfile +3 -0
  49. data/examples/new_ticket/new_ticket.rb +25 -0
  50. data/lib/slack-ruby-client.rb +29 -0
  51. data/lib/slack.rb +1 -0
  52. data/lib/slack/config.rb +21 -0
  53. data/lib/slack/messages/formatting.rb +30 -0
  54. data/lib/slack/real_time/api/message.rb +20 -0
  55. data/lib/slack/real_time/api/message_id.rb +14 -0
  56. data/lib/slack/real_time/api/ping.rb +16 -0
  57. data/lib/slack/real_time/api/typing.rb +17 -0
  58. data/lib/slack/real_time/client.rb +152 -0
  59. data/lib/slack/real_time/concurrency.rb +8 -0
  60. data/lib/slack/real_time/concurrency/celluloid.rb +93 -0
  61. data/lib/slack/real_time/concurrency/eventmachine.rb +39 -0
  62. data/lib/slack/real_time/config.rb +55 -0
  63. data/lib/slack/real_time/socket.rb +81 -0
  64. data/lib/slack/version.rb +3 -0
  65. data/lib/slack/web/api/endpoints.rb +53 -0
  66. data/lib/slack/web/api/endpoints/api.rb +24 -0
  67. data/lib/slack/web/api/endpoints/auth.rb +20 -0
  68. data/lib/slack/web/api/endpoints/channels.rb +220 -0
  69. data/lib/slack/web/api/endpoints/chat.rb +91 -0
  70. data/lib/slack/web/api/endpoints/dnd.rb +64 -0
  71. data/lib/slack/web/api/endpoints/emoji.rb +20 -0
  72. data/lib/slack/web/api/endpoints/files.rb +108 -0
  73. data/lib/slack/web/api/endpoints/groups.rb +247 -0
  74. data/lib/slack/web/api/endpoints/im.rb +85 -0
  75. data/lib/slack/web/api/endpoints/mpim.rb +84 -0
  76. data/lib/slack/web/api/endpoints/oauth.rb +32 -0
  77. data/lib/slack/web/api/endpoints/pins.rb +64 -0
  78. data/lib/slack/web/api/endpoints/presence.rb +23 -0
  79. data/lib/slack/web/api/endpoints/reactions.rb +89 -0
  80. data/lib/slack/web/api/endpoints/rtm.rb +27 -0
  81. data/lib/slack/web/api/endpoints/search.rb +65 -0
  82. data/lib/slack/web/api/endpoints/stars.rb +61 -0
  83. data/lib/slack/web/api/endpoints/team.rb +47 -0
  84. data/lib/slack/web/api/endpoints/usergroups.rb +113 -0
  85. data/lib/slack/web/api/endpoints/users.rb +73 -0
  86. data/lib/slack/web/api/error.rb +14 -0
  87. data/lib/slack/web/api/mixins.rb +3 -0
  88. data/lib/slack/web/api/mixins/channels.id.json +20 -0
  89. data/lib/slack/web/api/mixins/channels.id.rb +26 -0
  90. data/lib/slack/web/api/mixins/groups.id.json +20 -0
  91. data/lib/slack/web/api/mixins/groups.id.rb +26 -0
  92. data/lib/slack/web/api/mixins/users.id.json +20 -0
  93. data/lib/slack/web/api/mixins/users.id.rb +26 -0
  94. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +13 -0
  95. data/lib/slack/web/api/patches/chat.2.attachments-json.patch +17 -0
  96. data/lib/slack/web/api/schema/group.json +14 -0
  97. data/lib/slack/web/api/schema/method.json +45 -0
  98. data/lib/slack/web/api/tasks/generate.rake +61 -0
  99. data/lib/slack/web/api/templates/command.erb +34 -0
  100. data/lib/slack/web/api/templates/commands.erb +5 -0
  101. data/lib/slack/web/api/templates/endpoints.erb +21 -0
  102. data/lib/slack/web/api/templates/method.erb +49 -0
  103. data/lib/slack/web/client.rb +28 -0
  104. data/lib/slack/web/config.rb +41 -0
  105. data/lib/slack/web/faraday/connection.rb +29 -0
  106. data/lib/slack/web/faraday/request.rb +39 -0
  107. data/lib/slack/web/faraday/response/raise_error.rb +15 -0
  108. data/lib/slack_ruby_client.rb +1 -0
  109. data/screenshots/register-bot.png +0 -0
  110. data/slack-ruby-client.gemspec +31 -0
  111. data/slack.png +0 -0
  112. data/spec/fixtures/slack/web/429_error.yml +83 -0
  113. data/spec/fixtures/slack/web/auth_test_error.yml +48 -0
  114. data/spec/fixtures/slack/web/auth_test_success.yml +57 -0
  115. data/spec/fixtures/slack/web/channels_info.yml +46 -0
  116. data/spec/fixtures/slack/web/groups_info.yml +43 -0
  117. data/spec/fixtures/slack/web/rtm_start.yml +73 -0
  118. data/spec/fixtures/slack/web/users_info.yml +130 -0
  119. data/spec/fixtures/slack/web/users_list.yml +72 -0
  120. data/spec/integration/integration_spec.rb +107 -0
  121. data/spec/slack/config_spec.rb +14 -0
  122. data/spec/slack/messages/formatting_spec.rb +43 -0
  123. data/spec/slack/real_time/api/message_spec.rb +15 -0
  124. data/spec/slack/real_time/api/ping_spec.rb +15 -0
  125. data/spec/slack/real_time/api/typing_spec.rb +15 -0
  126. data/spec/slack/real_time/client_spec.rb +198 -0
  127. data/spec/slack/real_time/concurrency/celluloid_spec.rb +58 -0
  128. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +49 -0
  129. data/spec/slack/slack_spec.rb +58 -0
  130. data/spec/slack/version_spec.rb +7 -0
  131. data/spec/slack/web/api/endpoints/auth_spec.rb +20 -0
  132. data/spec/slack/web/api/endpoints/channels_spec.rb +11 -0
  133. data/spec/slack/web/api/endpoints/chat_spec.rb +33 -0
  134. data/spec/slack/web/api/endpoints/groups_spec.rb +11 -0
  135. data/spec/slack/web/api/endpoints/users_spec.rb +17 -0
  136. data/spec/slack/web/api/error_spec.rb +14 -0
  137. data/spec/slack/web/api/mixins/channels_spec.rb +31 -0
  138. data/spec/slack/web/api/mixins/groups_spec.rb +31 -0
  139. data/spec/slack/web/api/mixins/users_spec.rb +31 -0
  140. data/spec/slack/web/client_spec.rb +134 -0
  141. data/spec/spec_helper.rb +14 -0
  142. data/spec/support/queue_with_timeout.rb +34 -0
  143. data/spec/support/real_time/concurrency/mock.rb +31 -0
  144. data/spec/support/real_time/connected_client.rb +16 -0
  145. data/spec/support/token.rb +10 -0
  146. data/spec/support/vcr.rb +8 -0
  147. metadata +392 -0
@@ -0,0 +1,69 @@
1
+ # Releasing Slack-Ruby-Client
2
+
3
+ There're no hard rules about when to release slack-ruby-client. Release bug fixes frequenty, features not so frequently and breaking API changes rarely.
4
+
5
+ ### Release
6
+
7
+ Run tests, check that all tests succeed locally.
8
+
9
+ ```
10
+ bundle install
11
+ rake
12
+ ```
13
+
14
+ Check that the last build succeeded in [Travis CI](https://travis-ci.org/dblock/slack-ruby-client) for all supported platforms.
15
+
16
+ Increment the version, modify [lib/slack/version.rb](lib/slack/version.rb).
17
+
18
+ * Increment the third number if the release has bug fixes and/or very minor features, only (eg. change `0.2.1` to `0.2.2`).
19
+ * Increment the second number if the release contains major features or breaking API changes (eg. change `0.2.1` to `0.3.0`).
20
+
21
+ Change "Next Release" in [CHANGELOG.md](CHANGELOG.md) to the new version.
22
+
23
+ ```
24
+ ### 0.2.2 (7/10/2015)
25
+ ```
26
+
27
+ Remove the line with "Your contribution here.", since there will be no more contributions to this release.
28
+
29
+ Remove the "Stable Release" section in README that warns users that they are reading the documentation for an unreleased version.
30
+
31
+ Commit your changes.
32
+
33
+ ```
34
+ git add README.md CHANGELOG.md lib/slack/version.rb
35
+ git commit -m "Preparing for release, 0.2.2."
36
+ git push origin master
37
+ ```
38
+
39
+ Release.
40
+
41
+ ```
42
+ $ rake release
43
+
44
+ slack-ruby-client 0.2.2 built to pkg/slack-ruby-client-0.2.2.gem.
45
+ Tagged v0.2.2.
46
+ Pushed git commits and tags.
47
+ Pushed slack-ruby-client 0.2.2 to rubygems.org.
48
+ ```
49
+
50
+ ### Prepare for the Next Version
51
+
52
+ Add the next release to [CHANGELOG.md](CHANGELOG.md).
53
+
54
+ ```
55
+ Next Release
56
+ ============
57
+
58
+ * Your contribution here.
59
+ ```
60
+
61
+ Increment the third version number in [lib/slack/version.rb](lib/slack/version.rb).
62
+
63
+ Comit your changes.
64
+
65
+ ```
66
+ git add CHANGELOG.md lib/slack/version.rb
67
+ git commit -m "Preparing for next development iteration, 0.2.3."
68
+ git push origin master
69
+ ```
@@ -0,0 +1,19 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'bundler/gem_tasks'
4
+
5
+ Bundler.setup :default, :development
6
+
7
+ require 'rspec/core'
8
+ require 'rspec/core/rake_task'
9
+
10
+ RSpec::Core::RakeTask.new(:spec) do |spec|
11
+ spec.pattern = FileList['spec/**/*_spec.rb']
12
+ end
13
+
14
+ require 'rubocop/rake_task'
15
+ RuboCop::RakeTask.new
16
+
17
+ task default: [:rubocop, :spec]
18
+
19
+ load 'slack/web/api/tasks/generate.rake'
@@ -0,0 +1,26 @@
1
+ Upgrading Slack-Ruby-Client
2
+ ===========================
3
+
4
+ ### Upgrading to >= 0.5.0
5
+
6
+ #### Changes to Real Time Concurrency
7
+
8
+ Since 0.5.0 `Slack::RealTime::Client` supports [Celluloid](https://github.com/celluloid/celluloid) and no longer defaults to [Faye::WebSocket](https://github.com/faye/faye-websocket-ruby) with [Eventmachine](https://github.com/eventmachine/eventmachine). It will auto-detect one or the other depending on the gems in your Gemfile, which means you may need to add one or the other to your Gemfile.
9
+
10
+ ##### Faye::Websocket with Eventmachine
11
+
12
+ ```
13
+ gem 'faye-webSocket'
14
+ ```
15
+
16
+ ##### Celluloid
17
+
18
+ ```
19
+ gem 'celluloid-io'
20
+ ```
21
+
22
+ When in doubt, use Faye::WebSocket with Eventmachine.
23
+
24
+ See [#5](https://github.com/dblock/slack-ruby-client/issues/5) for more information.
25
+
26
+
@@ -0,0 +1,21 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ require 'commands/api'
4
+ require 'commands/auth'
5
+ require 'commands/channels'
6
+ require 'commands/chat'
7
+ require 'commands/dnd'
8
+ require 'commands/emoji'
9
+ require 'commands/files'
10
+ require 'commands/groups'
11
+ require 'commands/im'
12
+ require 'commands/mpim'
13
+ require 'commands/oauth'
14
+ require 'commands/pins'
15
+ require 'commands/reactions'
16
+ require 'commands/rtm'
17
+ require 'commands/search'
18
+ require 'commands/stars'
19
+ require 'commands/team'
20
+ require 'commands/usergroups'
21
+ require 'commands/users'
@@ -0,0 +1,14 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Api methods.'
4
+ command 'api' do |g|
5
+ g.desc 'This method helps you test your calling code.'
6
+ g.long_desc %( This method helps you test your calling code. )
7
+ g.command 'test' do |c|
8
+ c.flag 'error', desc: 'Error response to return.'
9
+ c.flag 'foo', desc: 'example property to return.'
10
+ c.action do |_global_options, options, _args|
11
+ puts JSON.dump($client.api_test(options))
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,12 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Auth methods.'
4
+ command 'auth' do |g|
5
+ g.desc 'This method checks authentication and tells you who you are.'
6
+ g.long_desc %( This method checks authentication and tells you who you are. )
7
+ g.command 'test' do |c|
8
+ c.action do |_global_options, options, _args|
9
+ puts JSON.dump($client.auth_test(options))
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,149 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc "Get info on your team's Slack channels, create or archive channels, invite users, set the topic and purpose, and mark a channel as read."
4
+ command 'channels' do |g|
5
+ g.desc 'This method archives a channel.'
6
+ g.long_desc %( This method archives a channel. )
7
+ g.command 'archive' do |c|
8
+ c.flag 'channel', desc: 'Channel to archive.'
9
+ c.action do |_global_options, options, _args|
10
+ puts JSON.dump($client.channels_archive(options))
11
+ end
12
+ end
13
+
14
+ g.desc 'This method is used to create a channel.'
15
+ g.long_desc %( This method is used to create a channel. )
16
+ g.command 'create' do |c|
17
+ c.flag 'name', desc: 'Name of channel to create.'
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump($client.channels_create(options))
20
+ end
21
+ end
22
+
23
+ g.desc 'This method returns a portion of messages/events from the specified channel.'
24
+ g.long_desc %( This method returns a portion of messages/events from the specified channel. To read the entire history for a channel, call the method with no latest or oldest arguments, and then continue paging using the instructions below. )
25
+ g.command 'history' do |c|
26
+ c.flag 'channel', desc: 'Channel to fetch history for.'
27
+ c.flag 'latest', desc: 'End of time range of messages to include in results.'
28
+ c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
29
+ c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
30
+ c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
31
+ c.action do |_global_options, options, _args|
32
+ puts JSON.dump($client.channels_history(options))
33
+ end
34
+ end
35
+
36
+ g.desc 'This method returns information about a team channel.'
37
+ g.long_desc %( This method returns information about a team channel. )
38
+ g.command 'info' do |c|
39
+ c.flag 'channel', desc: 'Channel to get info on.'
40
+ c.action do |_global_options, options, _args|
41
+ puts JSON.dump($client.channels_info(options))
42
+ end
43
+ end
44
+
45
+ g.desc 'This method is used to invite a user to a channel. The calling user must be a member of the channel.'
46
+ g.long_desc %( This method is used to invite a user to a channel. The calling user must be a member of the channel. )
47
+ g.command 'invite' do |c|
48
+ c.flag 'channel', desc: 'Channel to invite user to.'
49
+ c.flag 'user', desc: 'User to invite to channel.'
50
+ c.action do |_global_options, options, _args|
51
+ puts JSON.dump($client.channels_invite(options))
52
+ end
53
+ end
54
+
55
+ g.desc 'This method is used to join a channel. If the channel does not exist, it is'
56
+ g.long_desc %( This method is used to join a channel. If the channel does not exist, it is created. )
57
+ g.command 'join' do |c|
58
+ c.flag 'name', desc: 'Name of channel to join.'
59
+ c.action do |_global_options, options, _args|
60
+ puts JSON.dump($client.channels_join(options))
61
+ end
62
+ end
63
+
64
+ g.desc 'This method allows a user to remove another member from a team channel.'
65
+ g.long_desc %( This method allows a user to remove another member from a team channel. )
66
+ g.command 'kick' do |c|
67
+ c.flag 'channel', desc: 'Channel to remove user from.'
68
+ c.flag 'user', desc: 'User to remove from channel.'
69
+ c.action do |_global_options, options, _args|
70
+ puts JSON.dump($client.channels_kick(options))
71
+ end
72
+ end
73
+
74
+ g.desc 'This method is used to leave a channel.'
75
+ g.long_desc %( This method is used to leave a channel. )
76
+ g.command 'leave' do |c|
77
+ c.flag 'channel', desc: 'Channel to leave.'
78
+ c.action do |_global_options, options, _args|
79
+ puts JSON.dump($client.channels_leave(options))
80
+ end
81
+ end
82
+
83
+ g.desc 'This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived channels but does not include private channels. The number of (non-deactivated) members in each channel is also returned.'
84
+ g.long_desc %( This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived channels but does not include private channels. The number of (non-deactivated) members in each channel is also returned. )
85
+ g.command 'list' do |c|
86
+ c.flag 'exclude_archived', desc: "Don't return archived channels."
87
+ c.action do |_global_options, options, _args|
88
+ puts JSON.dump($client.channels_list(options))
89
+ end
90
+ end
91
+
92
+ g.desc 'This method moves the read cursor in a channel.'
93
+ g.long_desc %( This method moves the read cursor in a channel. )
94
+ g.command 'mark' do |c|
95
+ c.flag 'channel', desc: 'Channel to set reading cursor in.'
96
+ c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
97
+ c.action do |_global_options, options, _args|
98
+ puts JSON.dump($client.channels_mark(options))
99
+ end
100
+ end
101
+
102
+ g.desc 'This method renames a team channel.'
103
+ g.long_desc %( This method renames a team channel. )
104
+ g.command 'rename' do |c|
105
+ c.flag 'channel', desc: 'Channel to rename.'
106
+ c.flag 'name', desc: 'New name for channel.'
107
+ c.action do |_global_options, options, _args|
108
+ puts JSON.dump($client.channels_rename(options))
109
+ end
110
+ end
111
+
112
+ g.desc 'This method is used to change the purpose of a channel. The calling user must be a member of the channel.'
113
+ g.long_desc %( This method is used to change the purpose of a channel. The calling user must be a member of the channel. )
114
+ g.command 'setPurpose' do |c|
115
+ c.flag 'channel', desc: 'Channel to set the purpose of.'
116
+ c.flag 'purpose', desc: 'The new purpose.'
117
+ c.action do |_global_options, options, _args|
118
+ puts JSON.dump($client.channels_setPurpose(options))
119
+ end
120
+ end
121
+
122
+ g.desc 'This method is used to change the topic of a channel. The calling user must be a member of the channel.'
123
+ g.long_desc %( This method is used to change the topic of a channel. The calling user must be a member of the channel. )
124
+ g.command 'setTopic' do |c|
125
+ c.flag 'channel', desc: 'Channel to set the topic of.'
126
+ c.flag 'topic', desc: 'The new topic.'
127
+ c.action do |_global_options, options, _args|
128
+ puts JSON.dump($client.channels_setTopic(options))
129
+ end
130
+ end
131
+
132
+ g.desc 'This method unarchives a channel. The calling user is added to the channel.'
133
+ g.long_desc %( This method unarchives a channel. The calling user is added to the channel. )
134
+ g.command 'unarchive' do |c|
135
+ c.flag 'channel', desc: 'Channel to unarchive.'
136
+ c.action do |_global_options, options, _args|
137
+ puts JSON.dump($client.channels_unarchive(options))
138
+ end
139
+ end
140
+
141
+ g.desc 'This method returns the ID of a team channel.'
142
+ g.long_desc %( This method returns the ID of a team channel. )
143
+ g.command 'id' do |c|
144
+ c.flag 'channel', desc: 'Channel to get ID for, prefixed with #.'
145
+ c.action do |_global_options, options, _args|
146
+ puts JSON.dump($client.channels_id(options))
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,47 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Post chat messages to Slack.'
4
+ command 'chat' do |g|
5
+ g.desc 'This method deletes a message from a channel.'
6
+ g.long_desc %( This method deletes a message from a channel. )
7
+ g.command 'delete' do |c|
8
+ c.flag 'ts', desc: 'Timestamp of the message to be deleted.'
9
+ c.flag 'channel', desc: 'Channel containing the message to be deleted.'
10
+ c.action do |_global_options, options, _args|
11
+ puts JSON.dump($client.chat_delete(options))
12
+ end
13
+ end
14
+
15
+ g.desc 'This method posts a message to a public channel, private group, or IM channel.'
16
+ g.long_desc %( This method posts a message to a public channel, private group, or IM channel. )
17
+ g.command 'postMessage' do |c|
18
+ c.flag 'channel', desc: 'Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name. See below for more details.'
19
+ c.flag 'text', desc: 'Text of the message to send. See below for an explanation of formatting.'
20
+ c.flag 'username', desc: 'Name of bot.'
21
+ c.flag 'as_user', desc: 'Pass true to post the message as the authed user, instead of as a bot.'
22
+ c.flag 'parse', desc: 'Change how messages are treated. See below.'
23
+ c.flag 'link_names', desc: 'Find and link channel names and usernames.'
24
+ c.flag 'attachments', desc: 'Structured message attachments.'
25
+ c.flag 'unfurl_links', desc: 'Pass true to enable unfurling of primarily text-based content.'
26
+ c.flag 'unfurl_media', desc: 'Pass false to disable unfurling of media content.'
27
+ c.flag 'icon_url', desc: 'URL to an image to use as the icon for this message.'
28
+ c.flag 'icon_emoji', desc: 'emoji to use as the icon for this message. Overrides icon_url.'
29
+ c.action do |_global_options, options, _args|
30
+ puts JSON.dump($client.chat_postMessage(options))
31
+ end
32
+ end
33
+
34
+ g.desc 'This method updates a message in a channel.'
35
+ g.long_desc %( This method updates a message in a channel. )
36
+ g.command 'update' do |c|
37
+ c.flag 'ts', desc: 'Timestamp of the message to be updated.'
38
+ c.flag 'channel', desc: 'Channel containing the message to be updated.'
39
+ c.flag 'text', desc: 'New text for the message, using the default formatting rules.'
40
+ c.flag 'attachments', desc: 'Structured message attachments.'
41
+ c.flag 'parse', desc: 'Change how messages are treated. See below.'
42
+ c.flag 'link_names', desc: 'Find and link channel names and usernames.'
43
+ c.action do |_global_options, options, _args|
44
+ puts JSON.dump($client.chat_update(options))
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,47 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Adjust and view Do Not Disturb settings for team members'
4
+ command 'dnd' do |g|
5
+ g.desc "Ends the user's currently scheduled Do Not Disturb session immediately."
6
+ g.long_desc %( Ends the user's currently scheduled Do Not Disturb session immediately. )
7
+ g.command 'endDnd' do |c|
8
+ c.action do |_global_options, options, _args|
9
+ puts JSON.dump($client.dnd_endDnd(options))
10
+ end
11
+ end
12
+
13
+ g.desc "Ends the current user's snooze mode immediately."
14
+ g.long_desc %( Ends the current user's snooze mode immediately. )
15
+ g.command 'endSnooze' do |c|
16
+ c.action do |_global_options, options, _args|
17
+ puts JSON.dump($client.dnd_endSnooze(options))
18
+ end
19
+ end
20
+
21
+ g.desc "Provides information about a user's current Do Not Disturb settings."
22
+ g.long_desc %( Provides information about a user's current Do Not Disturb settings. )
23
+ g.command 'info' do |c|
24
+ c.flag 'user', desc: 'User to fetch status for (defaults to current user).'
25
+ c.action do |_global_options, options, _args|
26
+ puts JSON.dump($client.dnd_info(options))
27
+ end
28
+ end
29
+
30
+ g.desc "Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration."
31
+ g.long_desc %( Adjusts the snooze duration for a user's Do Not Disturb settings. If a snooze session is not already active for the user, invoking this method will begin one for the specified duration. )
32
+ g.command 'setSnooze' do |c|
33
+ c.flag 'num_minutes', desc: 'Number of minutes, from now, to snooze until.'
34
+ c.action do |_global_options, options, _args|
35
+ puts JSON.dump($client.dnd_setSnooze(options))
36
+ end
37
+ end
38
+
39
+ g.desc 'Provides information about the current Do Not Disturb settings for users of a Slack team.'
40
+ g.long_desc %( Provides information about the current Do Not Disturb settings for users of a Slack team. )
41
+ g.command 'teamInfo' do |c|
42
+ c.flag 'users', desc: 'Comma-separated list of users to fetch Do Not Disturb status for.'
43
+ c.action do |_global_options, options, _args|
44
+ puts JSON.dump($client.dnd_teamInfo(options))
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,12 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Emoji methods.'
4
+ command 'emoji' do |g|
5
+ g.desc 'This method lists the custom emoji for a team.'
6
+ g.long_desc %( This method lists the custom emoji for a team. )
7
+ g.command 'list' do |c|
8
+ c.action do |_global_options, options, _args|
9
+ puts JSON.dump($client.emoji_list(options))
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,72 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Get info on files uploaded to Slack, upload new files to Slack.'
4
+ command 'files' do |g|
5
+ g.desc 'Edit an existing comment on a file. Only the user who created a comment may make edits. Teams may configure a limited time window during which file comment edits are allowed.'
6
+ g.long_desc %( Edit an existing comment on a file. Only the user who created a comment may make edits. Teams may configure a limited time window during which file comment edits are allowed. )
7
+ g.command 'comments' do |c|
8
+ c.flag 'file', desc: 'File containing the comment to edit.'
9
+ c.flag 'id', desc: 'The comment to edit.'
10
+ c.flag 'comment', desc: 'Text of the comment to edit.'
11
+ c.action do |_global_options, options, _args|
12
+ puts JSON.dump($client.files_comments(options))
13
+ end
14
+ end
15
+
16
+ g.desc 'This method deletes a file from your team.'
17
+ g.long_desc %( This method deletes a file from your team. )
18
+ g.command 'delete' do |c|
19
+ c.flag 'file', desc: 'ID of file to delete.'
20
+ c.action do |_global_options, options, _args|
21
+ puts JSON.dump($client.files_delete(options))
22
+ end
23
+ end
24
+
25
+ g.desc 'This method returns information about a file in your team.'
26
+ g.long_desc %( This method returns information about a file in your team. )
27
+ g.command 'info' do |c|
28
+ c.flag 'file', desc: 'File to fetch info for.'
29
+ c.action do |_global_options, options, _args|
30
+ puts JSON.dump($client.files_info(options))
31
+ end
32
+ end
33
+
34
+ g.desc 'This method returns a list of files within the team. It can be filtered and sliced in various ways.'
35
+ g.long_desc %( This method returns a list of files within the team. It can be filtered and sliced in various ways. )
36
+ g.command 'list' do |c|
37
+ c.flag 'user', desc: 'Filter files created by a single user.'
38
+ c.flag 'ts_from', desc: 'Filter files created after this timestamp (inclusive).'
39
+ c.flag 'ts_to', desc: 'Filter files created before this timestamp (inclusive).'
40
+ c.flag 'types', desc: 'Filter files by type:
41
+
42
+ all - All files
43
+ posts - Posts
44
+ snippets - Snippets
45
+ images - Image files
46
+ gdocs - Google docs
47
+ zips - Zip files
48
+ pdfs - PDF files
49
+
50
+
51
+ You can pass multiple values in the types argument, like types=posts,snippets.The default value is all, which does not filter the list.
52
+ .'
53
+ c.action do |_global_options, options, _args|
54
+ puts JSON.dump($client.files_list(options))
55
+ end
56
+ end
57
+
58
+ g.desc 'This method allows you to create or upload an existing file.'
59
+ g.long_desc %( This method allows you to create or upload an existing file. )
60
+ g.command 'upload' do |c|
61
+ c.flag 'file', desc: 'File contents via multipart/form-data.'
62
+ c.flag 'content', desc: 'File contents via a POST var.'
63
+ c.flag 'filetype', desc: 'Slack-internal file type identifier.'
64
+ c.flag 'filename', desc: 'Filename of file.'
65
+ c.flag 'title', desc: 'Title of file.'
66
+ c.flag 'initial_comment', desc: 'Initial comment to add to file.'
67
+ c.flag 'channels', desc: 'Comma-separated list of channel names or IDs where the file will be shared.'
68
+ c.action do |_global_options, options, _args|
69
+ puts JSON.dump($client.files_upload(options))
70
+ end
71
+ end
72
+ end