diff --git a/Directory.Packages.props b/Directory.Packages.props index e33359f..44a33ee 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -9,7 +9,7 @@ - + diff --git a/src/Nocr.TextMatcher.AppServices/TextMatchers/MessageReceivedHandler.cs b/src/Nocr.TextMatcher.AppServices/TextMatchers/MessageReceivedHandler.cs index 3e8c7a0..b52ce8c 100644 --- a/src/Nocr.TextMatcher.AppServices/TextMatchers/MessageReceivedHandler.cs +++ b/src/Nocr.TextMatcher.AppServices/TextMatchers/MessageReceivedHandler.cs @@ -41,6 +41,11 @@ public sealed class MessageReceivedHandler : IHandleMessages { MatchId = match.Id, MatchUserId = match.UserId, + ChatUsername = match.ChatUsername, + Rule = (int)match.Rule, + Template = match.Template, + Text = message.Text, + FromUsername = message.FromUsername, OccuredDateTime = message.OccuredDateTime, PublishedDateTime = _dateProvider.UtcNow }; diff --git a/src/Nocr.TextMatcher.AppServices/TextMatches/TextMatch.cs b/src/Nocr.TextMatcher.AppServices/TextMatches/TextMatch.cs index 82f9639..3d3b87c 100644 --- a/src/Nocr.TextMatcher.AppServices/TextMatches/TextMatch.cs +++ b/src/Nocr.TextMatcher.AppServices/TextMatches/TextMatch.cs @@ -57,7 +57,7 @@ public sealed class TextMatch public void Disable() { - if (Active == false) + if (!Active) { throw new InvalidOperationException("Failed to disable inactive match"); } @@ -67,7 +67,7 @@ public sealed class TextMatch public void Activate() { - if (Active == true) + if (Active) { throw new InvalidOperationException("Failed to activate inactive match"); } diff --git a/src/Nocr.TextMatcher.Async.Api.Contracts/TextMatchMatched.cs b/src/Nocr.TextMatcher.Async.Api.Contracts/TextMatchMatched.cs index 24eba16..2ff2099 100644 --- a/src/Nocr.TextMatcher.Async.Api.Contracts/TextMatchMatched.cs +++ b/src/Nocr.TextMatcher.Async.Api.Contracts/TextMatchMatched.cs @@ -8,6 +8,16 @@ public class TextMatchMatched : IEvent public long MatchUserId { get; set; } + public string ChatUsername { get; set; } + + public int Rule { get; set; } + + public string Template { get; set; } + + public string? FromUsername { get; set; } + + public string Text { get; set; } + public DateTimeOffset OccuredDateTime { get; set; } public DateTimeOffset PublishedDateTime { get; set; }