Skip to content

SlackClient.SearchFiles is not usable #106

@mhgamework

Description

@mhgamework

The SlackClient.SearchFiles returns a SearchResponseFiles, which does not publicly expose the "files" field.
Furthermore, the SearchResponseFiles class has a private field "messages" which does not seem to make sense.

The SearchResponseFiles.cs file can be fixed by adding a public "files" field and remove the "messages field". I suggest this is merged into the project.
I currently use a workaround, where i copied the SlackClient.SearchFiles and have it use my own SearchResponseFiles class.

Corrected code:

[RequestPath("search.files")]
public class SearchResponseFiles : Response
{
    public string query;
    public SearchResponseFilesContainer files; // files, not messages AND public
}

public class SearchResponseFilesContainer
{
    /// <summary>
    /// Can be null if used in the context of search.all
    /// Please use paging.total instead.
    /// </summary>
    public int total;
    public PaginationInformation paging;
    public File[] matches;
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions