This repository was archived by the owner on Jan 28, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ public final class WebAPI {
5353 case channel, group, im
5454 }
5555
56+ public enum ConversationType : String {
57+ case public_channel, private_channel, mpim, im
58+ }
59+
5660 fileprivate let networkInterface : NetworkInterface
5761 fileprivate let token : String
5862
@@ -1103,7 +1107,7 @@ extension WebAPI {
11031107 excludeArchived: Bool = false ,
11041108 cursor: String ? = nil ,
11051109 limit: Int ? = nil ,
1106- types: [ String ] ? = nil ,
1110+ types: [ ConversationType ] ? = nil ,
11071111 success: ( ( _ channels: [ [ String : Any ] ] ? ) -> Void ) ? ,
11081112 failure: FailureClosure ?
11091113 ) {
@@ -1115,7 +1119,7 @@ extension WebAPI {
11151119 parameters [ " limit " ] = limit
11161120 }
11171121 if let types = types {
1118- parameters [ " types " ] = types. joined ( separator: " , " )
1122+ parameters [ " types " ] = types. map ( { $0 . rawValue } ) . joined ( separator: " , " )
11191123 }
11201124 networkInterface. request ( . conversationsList, parameters: parameters, successClosure: { ( response) in
11211125 success ? ( response [ " channels " ] as? [ [ String : Any ] ] )
You can’t perform that action at this time.
0 commit comments