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,167 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc "Get info on your team's private channels."
4
+ command 'groups' do |g|
5
+ g.desc 'This method archives a private channel.'
6
+ g.long_desc %( This method archives a private channel. )
7
+ g.command 'archive' do |c|
8
+ c.flag 'channel', desc: 'Private channel to archive.'
9
+ c.action do |_global_options, options, _args|
10
+ puts JSON.dump($client.groups_archive(options))
11
+ end
12
+ end
13
+
14
+ g.desc 'This method closes a private channel.'
15
+ g.long_desc %( This method closes a private channel. )
16
+ g.command 'close' do |c|
17
+ c.flag 'channel', desc: 'Private channel to close.'
18
+ c.action do |_global_options, options, _args|
19
+ puts JSON.dump($client.groups_close(options))
20
+ end
21
+ end
22
+
23
+ g.desc 'This method creates a private channel.'
24
+ g.long_desc %( This method creates a private channel. )
25
+ g.command 'create' do |c|
26
+ c.flag 'name', desc: 'Name of private channel to create.'
27
+ c.action do |_global_options, options, _args|
28
+ puts JSON.dump($client.groups_create(options))
29
+ end
30
+ end
31
+
32
+ g.desc 'This method takes an existing private channel and performs the following steps:'
33
+ g.long_desc %( This method takes an existing private channel and performs the following steps: )
34
+ g.command 'createChild' do |c|
35
+ c.flag 'channel', desc: 'Private channel to clone and archive.'
36
+ c.action do |_global_options, options, _args|
37
+ puts JSON.dump($client.groups_createChild(options))
38
+ end
39
+ end
40
+
41
+ g.desc 'This method returns a portion of messages/events from the specified private channel.'
42
+ g.long_desc %( This method returns a portion of messages/events from the specified private channel. To read the entire history for a private channel, call the method with no latest or oldest arguments, and then continue paging using the instructions below. )
43
+ g.command 'history' do |c|
44
+ c.flag 'channel', desc: 'Private channel to fetch history for.'
45
+ c.flag 'latest', desc: 'End of time range of messages to include in results.'
46
+ c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
47
+ c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
48
+ c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
49
+ c.action do |_global_options, options, _args|
50
+ puts JSON.dump($client.groups_history(options))
51
+ end
52
+ end
53
+
54
+ g.desc 'This method returns information about a private channel.'
55
+ g.long_desc %( This method returns information about a private channel. )
56
+ g.command 'info' do |c|
57
+ c.flag 'channel', desc: 'Private channel to get info on.'
58
+ c.action do |_global_options, options, _args|
59
+ puts JSON.dump($client.groups_info(options))
60
+ end
61
+ end
62
+
63
+ g.desc 'This method is used to invite a user to a private channel. The calling user must be a member of the private channel.'
64
+ g.long_desc %( This method is used to invite a user to a private channel. The calling user must be a member of the private channel. )
65
+ g.command 'invite' do |c|
66
+ c.flag 'channel', desc: 'Private channel to invite user to.'
67
+ c.flag 'user', desc: 'User to invite.'
68
+ c.action do |_global_options, options, _args|
69
+ puts JSON.dump($client.groups_invite(options))
70
+ end
71
+ end
72
+
73
+ g.desc 'This method allows a user to remove another member from a private channel.'
74
+ g.long_desc %( This method allows a user to remove another member from a private channel. )
75
+ g.command 'kick' do |c|
76
+ c.flag 'channel', desc: 'Private channel to remove user from.'
77
+ c.flag 'user', desc: 'User to remove from private channel.'
78
+ c.action do |_global_options, options, _args|
79
+ puts JSON.dump($client.groups_kick(options))
80
+ end
81
+ end
82
+
83
+ g.desc 'This method is used to leave a private channel.'
84
+ g.long_desc %( This method is used to leave a private channel. )
85
+ g.command 'leave' do |c|
86
+ c.flag 'channel', desc: 'Private channel to leave.'
87
+ c.action do |_global_options, options, _args|
88
+ puts JSON.dump($client.groups_leave(options))
89
+ end
90
+ end
91
+
92
+ g.desc 'This method returns a list of private channels in the team that the caller is in and archived groups that the caller was in.'
93
+ g.long_desc %( This method returns a list of private channels in the team that the caller is in and archived groups that the caller was in. The list of (non-deactivated) members in each private channel is also returned. )
94
+ g.command 'list' do |c|
95
+ c.flag 'exclude_archived', desc: "Don't return archived private channels."
96
+ c.action do |_global_options, options, _args|
97
+ puts JSON.dump($client.groups_list(options))
98
+ end
99
+ end
100
+
101
+ g.desc 'This method moves the read cursor in a private channel.'
102
+ g.long_desc %( This method moves the read cursor in a private channel. )
103
+ g.command 'mark' do |c|
104
+ c.flag 'channel', desc: 'Private channel to set reading cursor in.'
105
+ c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
106
+ c.action do |_global_options, options, _args|
107
+ puts JSON.dump($client.groups_mark(options))
108
+ end
109
+ end
110
+
111
+ g.desc 'This method opens a private channel.'
112
+ g.long_desc %( This method opens a private channel. )
113
+ g.command 'open' do |c|
114
+ c.flag 'channel', desc: 'Private channel to open.'
115
+ c.action do |_global_options, options, _args|
116
+ puts JSON.dump($client.groups_open(options))
117
+ end
118
+ end
119
+
120
+ g.desc 'This method renames a private channel.'
121
+ g.long_desc %( This method renames a private channel. )
122
+ g.command 'rename' do |c|
123
+ c.flag 'channel', desc: 'Private channel to rename.'
124
+ c.flag 'name', desc: 'New name for private channel.'
125
+ c.action do |_global_options, options, _args|
126
+ puts JSON.dump($client.groups_rename(options))
127
+ end
128
+ end
129
+
130
+ g.desc 'This method is used to change the purpose of a private channel. The calling user must be a member of the private channel.'
131
+ g.long_desc %( This method is used to change the purpose of a private channel. The calling user must be a member of the private channel. )
132
+ g.command 'setPurpose' do |c|
133
+ c.flag 'channel', desc: 'Private channel to set the purpose of.'
134
+ c.flag 'purpose', desc: 'The new purpose.'
135
+ c.action do |_global_options, options, _args|
136
+ puts JSON.dump($client.groups_setPurpose(options))
137
+ end
138
+ end
139
+
140
+ g.desc 'This method is used to change the topic of a private channel. The calling user must be a member of the private channel.'
141
+ g.long_desc %( This method is used to change the topic of a private channel. The calling user must be a member of the private channel. )
142
+ g.command 'setTopic' do |c|
143
+ c.flag 'channel', desc: 'Private channel to set the topic of.'
144
+ c.flag 'topic', desc: 'The new topic.'
145
+ c.action do |_global_options, options, _args|
146
+ puts JSON.dump($client.groups_setTopic(options))
147
+ end
148
+ end
149
+
150
+ g.desc 'This method unarchives a private channel.'
151
+ g.long_desc %( This method unarchives a private channel. )
152
+ g.command 'unarchive' do |c|
153
+ c.flag 'channel', desc: 'Private channel to unarchive.'
154
+ c.action do |_global_options, options, _args|
155
+ puts JSON.dump($client.groups_unarchive(options))
156
+ end
157
+ end
158
+
159
+ g.desc 'This method returns the ID of a group.'
160
+ g.long_desc %( This method returns the ID of a group. )
161
+ g.command 'id' do |c|
162
+ c.flag 'channel', desc: 'Group channel to get ID for, prefixed with #.'
163
+ c.action do |_global_options, options, _args|
164
+ puts JSON.dump($client.groups_id(options))
165
+ end
166
+ end
167
+ end
@@ -0,0 +1,53 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Get info on your direct messages.'
4
+ command 'im' do |g|
5
+ g.desc 'This method closes a direct message channel.'
6
+ g.long_desc %( This method closes a direct message channel. )
7
+ g.command 'close' do |c|
8
+ c.flag 'channel', desc: 'Direct message channel to close.'
9
+ c.action do |_global_options, options, _args|
10
+ puts JSON.dump($client.im_close(options))
11
+ end
12
+ end
13
+
14
+ g.desc 'This method returns a portion of messages/events from the specified direct message channel.'
15
+ g.long_desc %( This method returns a portion of messages/events from the specified direct message channel. To read the entire history for a direct message channel, call the method with no latest or oldest arguments, and then continue paging using the instructions below. )
16
+ g.command 'history' do |c|
17
+ c.flag 'channel', desc: 'Direct message channel to fetch history for.'
18
+ c.flag 'latest', desc: 'End of time range of messages to include in results.'
19
+ c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
20
+ c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
21
+ c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump($client.im_history(options))
24
+ end
25
+ end
26
+
27
+ g.desc 'This method returns a list of all im channels that the user has.'
28
+ g.long_desc %( This method returns a list of all im channels that the user has. )
29
+ g.command 'list' do |c|
30
+ c.action do |_global_options, options, _args|
31
+ puts JSON.dump($client.im_list(options))
32
+ end
33
+ end
34
+
35
+ g.desc 'This method moves the read cursor in a direct message channel.'
36
+ g.long_desc %( This method moves the read cursor in a direct message channel. )
37
+ g.command 'mark' do |c|
38
+ c.flag 'channel', desc: 'Direct message channel to set reading cursor in.'
39
+ c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
40
+ c.action do |_global_options, options, _args|
41
+ puts JSON.dump($client.im_mark(options))
42
+ end
43
+ end
44
+
45
+ g.desc 'This method opens a direct message channel with another member of your Slack team.'
46
+ g.long_desc %( This method opens a direct message channel with another member of your Slack team. )
47
+ g.command 'open' do |c|
48
+ c.flag 'user', desc: 'User to open a direct message channel with.'
49
+ c.action do |_global_options, options, _args|
50
+ puts JSON.dump($client.im_open(options))
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,53 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Get info on your multiparty direct messages.'
4
+ command 'mpim' do |g|
5
+ g.desc 'This method closes a multiparty direct message channel.'
6
+ g.long_desc %( This method closes a multiparty direct message channel. )
7
+ g.command 'close' do |c|
8
+ c.flag 'channel', desc: 'MPIM to close.'
9
+ c.action do |_global_options, options, _args|
10
+ puts JSON.dump($client.mpim_close(options))
11
+ end
12
+ end
13
+
14
+ g.desc 'This method returns a portion of messages/events from the specified multiparty direct message channel.'
15
+ g.long_desc %( This method returns a portion of messages/events from the specified multiparty direct message channel. To read the entire history for a multiparty direct message, call the method with no latest or oldest arguments, and then continue paging using the instructions below. )
16
+ g.command 'history' do |c|
17
+ c.flag 'channel', desc: 'Multiparty direct message to fetch history for.'
18
+ c.flag 'latest', desc: 'End of time range of messages to include in results.'
19
+ c.flag 'oldest', desc: 'Start of time range of messages to include in results.'
20
+ c.flag 'inclusive', desc: 'Include messages with latest or oldest timestamp in results.'
21
+ c.flag 'unreads', desc: 'Include unread_count_display in the output?.'
22
+ c.action do |_global_options, options, _args|
23
+ puts JSON.dump($client.mpim_history(options))
24
+ end
25
+ end
26
+
27
+ g.desc 'This method returns a list of all multiparty direct message channels that the user has.'
28
+ g.long_desc %( This method returns a list of all multiparty direct message channels that the user has. )
29
+ g.command 'list' do |c|
30
+ c.action do |_global_options, options, _args|
31
+ puts JSON.dump($client.mpim_list(options))
32
+ end
33
+ end
34
+
35
+ g.desc 'This method moves the read cursor in a multiparty direct message channel.'
36
+ g.long_desc %( This method moves the read cursor in a multiparty direct message channel. )
37
+ g.command 'mark' do |c|
38
+ c.flag 'channel', desc: 'multiparty direct message channel to set reading cursor in.'
39
+ c.flag 'ts', desc: 'Timestamp of the most recently seen message.'
40
+ c.action do |_global_options, options, _args|
41
+ puts JSON.dump($client.mpim_mark(options))
42
+ end
43
+ end
44
+
45
+ g.desc 'This method opens a multiparty direct message.'
46
+ g.long_desc %( This method opens a multiparty direct message. )
47
+ g.command 'open' do |c|
48
+ c.flag 'users', desc: 'Comma separated lists of users. The ordering of the users is preserved whenever a MPIM group is returned.'
49
+ c.action do |_global_options, options, _args|
50
+ puts JSON.dump($client.mpim_open(options))
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,16 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Oauth methods.'
4
+ command 'oauth' do |g|
5
+ g.desc 'This method allows you to exchange a temporary OAuth code for an API access token.'
6
+ g.long_desc %( This method allows you to exchange a temporary OAuth code for an API access token. This is used as part of the OAuth authentication flow. )
7
+ g.command 'access' do |c|
8
+ c.flag 'client_id', desc: 'Issued when you created your application.'
9
+ c.flag 'client_secret', desc: 'Issued when you created your application.'
10
+ c.flag 'code', desc: 'The code param returned via the OAuth callback.'
11
+ c.flag 'redirect_uri', desc: 'This must match the originally submitted URI (if one was sent).'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.oauth_access(options))
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,37 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Pins methods.'
4
+ command 'pins' do |g|
5
+ g.desc 'This method pins an item (file, file comment, channel message, or group message) to a particular channel.'
6
+ g.long_desc %( This method pins an item (file, file comment, channel message, or group message) to a particular channel. The channel argument is required and one of file, file_comment, or timestamp must also be specified. )
7
+ g.command 'add' do |c|
8
+ c.flag 'channel', desc: 'Channel to pin the item in.'
9
+ c.flag 'file', desc: 'File to pin.'
10
+ c.flag 'file_comment', desc: 'File comment to pin.'
11
+ c.flag 'timestamp', desc: 'Timestamp of the message to pin.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.pins_add(options))
14
+ end
15
+ end
16
+
17
+ g.desc 'This method lists the items pinned to a channel.'
18
+ g.long_desc %( This method lists the items pinned to a channel. )
19
+ g.command 'list' do |c|
20
+ c.flag 'channel', desc: 'Channel to get pinned items for.'
21
+ c.action do |_global_options, options, _args|
22
+ puts JSON.dump($client.pins_list(options))
23
+ end
24
+ end
25
+
26
+ g.desc 'This method un-pins an item (file, file comment, channel message, or group message) from a channel.'
27
+ g.long_desc %( This method un-pins an item (file, file comment, channel message, or group message) from a channel. The channel argument is required and one of file, file_comment, or timestamp must also be specified. )
28
+ g.command 'remove' do |c|
29
+ c.flag 'channel', desc: 'Channel where the item is pinned to.'
30
+ c.flag 'file', desc: 'File to un-pin.'
31
+ c.flag 'file_comment', desc: 'File comment to un-pin.'
32
+ c.flag 'timestamp', desc: 'Timestamp of the message to un-pin.'
33
+ c.action do |_global_options, options, _args|
34
+ puts JSON.dump($client.pins_remove(options))
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,53 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Reactions methods.'
4
+ command 'reactions' do |g|
5
+ g.desc 'This method adds a reaction (emoji) to an item (file, file comment, channel message, group message, or direct message).'
6
+ g.long_desc %( This method adds a reaction (emoji) to an item (file, file comment, channel message, group message, or direct message). One of file, file_comment, or the combination of channel and timestamp must be specified. )
7
+ g.command 'add' do |c|
8
+ c.flag 'name', desc: 'Reaction (emoji) name.'
9
+ c.flag 'file', desc: 'File to add reaction to.'
10
+ c.flag 'file_comment', desc: 'File comment to add reaction to.'
11
+ c.flag 'channel', desc: 'Channel where the message to add reaction to was posted.'
12
+ c.flag 'timestamp', desc: 'Timestamp of the message to add reaction to.'
13
+ c.action do |_global_options, options, _args|
14
+ puts JSON.dump($client.reactions_add(options))
15
+ end
16
+ end
17
+
18
+ g.desc 'This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message).'
19
+ g.long_desc %( This method returns a list of all reactions for a single item (file, file comment, channel message, group message, or direct message). )
20
+ g.command 'get' do |c|
21
+ c.flag 'file', desc: 'File to get reactions for.'
22
+ c.flag 'file_comment', desc: 'File comment to get reactions for.'
23
+ c.flag 'channel', desc: 'Channel where the message to get reactions for was posted.'
24
+ c.flag 'timestamp', desc: 'Timestamp of the message to get reactions for.'
25
+ c.flag 'full', desc: 'If true always return the complete reaction list.'
26
+ c.action do |_global_options, options, _args|
27
+ puts JSON.dump($client.reactions_get(options))
28
+ end
29
+ end
30
+
31
+ g.desc 'This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user.'
32
+ g.long_desc %( This method returns a list of all items (file, file comment, channel message, group message, or direct message) reacted to by a user. )
33
+ g.command 'list' do |c|
34
+ c.flag 'user', desc: 'Show reactions made by this user. Defaults to the authed user.'
35
+ c.flag 'full', desc: 'If true always return the complete reaction list.'
36
+ c.action do |_global_options, options, _args|
37
+ puts JSON.dump($client.reactions_list(options))
38
+ end
39
+ end
40
+
41
+ g.desc 'This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message).'
42
+ g.long_desc %( This method removes a reaction (emoji) from an item (file, file comment, channel message, group message, or direct message). One of file, file_comment, or the combination of channel and timestamp must be specified. )
43
+ g.command 'remove' do |c|
44
+ c.flag 'name', desc: 'Reaction (emoji) name.'
45
+ c.flag 'file', desc: 'File to remove reaction from.'
46
+ c.flag 'file_comment', desc: 'File comment to remove reaction from.'
47
+ c.flag 'channel', desc: 'Channel where the message to remove reaction from was posted.'
48
+ c.flag 'timestamp', desc: 'Timestamp of the message to remove reaction from.'
49
+ c.action do |_global_options, options, _args|
50
+ puts JSON.dump($client.reactions_remove(options))
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,15 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Rtm methods.'
4
+ command 'rtm' do |g|
5
+ g.desc 'This method starts a Real Time Messaging API session. Refer to the'
6
+ g.long_desc %( This method starts a Real Time Messaging API session. Refer to the RTM API documentation for full details on how to use the RTM API. )
7
+ g.command 'start' do |c|
8
+ c.flag 'simple_latest', desc: 'Return timestamp only for latest message object of each channel (improves performance).'
9
+ c.flag 'no_unreads', desc: 'Skip unread counts for each channel (improves performance).'
10
+ c.flag 'mpim_aware', desc: 'Returns MPIMs to the client in the API response.'
11
+ c.action do |_global_options, options, _args|
12
+ puts JSON.dump($client.rtm_start(options))
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,40 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc "Search your team's files and messages."
4
+ command 'search' do |g|
5
+ g.desc 'This method allows to to search both messages and files in a single call.'
6
+ g.long_desc %( This method allows to to search both messages and files in a single call. )
7
+ g.command 'all' do |c|
8
+ c.flag 'query', desc: 'Search query. May contains booleans, etc.'
9
+ c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
10
+ c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
11
+ c.flag 'highlight', desc: 'Pass a value of 1 to enable query highlight markers (see below).'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.search_all(options))
14
+ end
15
+ end
16
+
17
+ g.desc 'This method returns files matching a search query.'
18
+ g.long_desc %( This method returns files matching a search query. )
19
+ g.command 'files' do |c|
20
+ c.flag 'query', desc: 'Search query. May contain booleans, etc.'
21
+ c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
22
+ c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
23
+ c.flag 'highlight', desc: 'Pass a value of 1 to enable query highlight markers (see below).'
24
+ c.action do |_global_options, options, _args|
25
+ puts JSON.dump($client.search_files(options))
26
+ end
27
+ end
28
+
29
+ g.desc 'This method returns messages matching a search query.'
30
+ g.long_desc %( This method returns messages matching a search query. )
31
+ g.command 'messages' do |c|
32
+ c.flag 'query', desc: 'Search query. May contains booleans, etc.'
33
+ c.flag 'sort', desc: 'Return matches sorted by either score or timestamp.'
34
+ c.flag 'sort_dir', desc: 'Change sort direction to ascending (asc) or descending (desc).'
35
+ c.flag 'highlight', desc: 'Pass a value of 1 to enable query highlight markers (see below).'
36
+ c.action do |_global_options, options, _args|
37
+ puts JSON.dump($client.search_messages(options))
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,37 @@
1
+ # This file was auto-generated by lib/slack/web/api/tasks/generate.rake
2
+
3
+ desc 'Stars methods.'
4
+ command 'stars' do |g|
5
+ g.desc 'This method adds a star to an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user.'
6
+ g.long_desc %( This method adds a star to an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user. One of file, file_comment, channel, or the combination of channel and timestamp must be specified. )
7
+ g.command 'add' do |c|
8
+ c.flag 'file', desc: 'File to add star to.'
9
+ c.flag 'file_comment', desc: 'File comment to add star to.'
10
+ c.flag 'channel', desc: 'Channel to add star to, or channel where the message to add star to was posted (used with timestamp).'
11
+ c.flag 'timestamp', desc: 'Timestamp of the message to add star to.'
12
+ c.action do |_global_options, options, _args|
13
+ puts JSON.dump($client.stars_add(options))
14
+ end
15
+ end
16
+
17
+ g.desc 'This method lists the items starred by a user.'
18
+ g.long_desc %( This method lists the items starred by a user. )
19
+ g.command 'list' do |c|
20
+ c.flag 'user', desc: 'Show stars by this user. Defaults to the authed user.'
21
+ c.action do |_global_options, options, _args|
22
+ puts JSON.dump($client.stars_list(options))
23
+ end
24
+ end
25
+
26
+ g.desc 'This method removes a star from an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user.'
27
+ g.long_desc %( This method removes a star from an item (message, file, file comment, channel, private group, or DM) on behalf of the authenticated user. One of file, file_comment, channel, or the combination of channel and timestamp must be specified. )
28
+ g.command 'remove' do |c|
29
+ c.flag 'file', desc: 'File to remove star from.'
30
+ c.flag 'file_comment', desc: 'File comment to remove star from.'
31
+ c.flag 'channel', desc: 'Channel to remove star from, or channel where the message to remove star from was posted (used with timestamp).'
32
+ c.flag 'timestamp', desc: 'Timestamp of the message to remove star from.'
33
+ c.action do |_global_options, options, _args|
34
+ puts JSON.dump($client.stars_remove(options))
35
+ end
36
+ end
37
+ end