Skip to content

Commit

Permalink
Adding MessageSearchResult class for search results
Browse files Browse the repository at this point in the history
  • Loading branch information
soxtoby committed Dec 24, 2022
1 parent 2e2ce44 commit 4be9237
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
6 changes: 2 additions & 4 deletions SlackNet/WebApi/Responses/MessageSearchResponse.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using SlackNet.Events;

namespace SlackNet.WebApi;
namespace SlackNet.WebApi;

public class MessageSearchResponse
{
public string Query { get; set; }
public SearchResults<MessageEvent> Messages { get; set; }
public SearchResults<MessageSearchResult> Messages { get; set; }
}
28 changes: 28 additions & 0 deletions SlackNet/WebApi/Responses/MessageSearchResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using SlackNet.Blocks;

namespace SlackNet.WebApi;

public class MessageSearchResult
{
public string Iid { get; set; }
public string Team { get; set; }
public double Score { get; set; }
public Conversation Channel { get; set; }
public string Type { get; set; }
public string User { get; set; }
public string Username { get; set; }
public string Ts { get; set; }
public IList<Block> Blocks { get; set; } = new List<Block>();
public string Text { get; set; }
public string Permalink { get; set; }
public bool NoReactions { get; set; }

/// <summary>
/// Anything that Slack includes in the search result that isn't covered by other properties can be accessed through this property.
/// If you find anything here, please raise an issue at https://github.com/soxtoby/SlackNet/issues so we can add it to the library.
/// </summary>
[JsonExtensionData]
public Dictionary<string, object> ExtraProperties { get; set; } = new();
}
6 changes: 2 additions & 4 deletions SlackNet/WebApi/Responses/SearchResponse.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using SlackNet.Events;

namespace SlackNet.WebApi;
namespace SlackNet.WebApi;

public class SearchResponse
{
public string Query { get; set; }
public SearchResults<MessageEvent> Messages { get; set; }
public SearchResults<MessageSearchResult> Messages { get; set; }
public SearchResults<File> Files { get; set; }
}

0 comments on commit 4be9237

Please sign in to comment.