-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from atidev/mm_bot
Add mattermost's bot support
- Loading branch information
Showing
12 changed files
with
245 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
using ATI.Services.Common.Extensions; | ||
using JetBrains.Annotations; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace ATI.Services.Common.Mattermost; | ||
|
||
[PublicAPI] | ||
public static class MattermostExtensions | ||
{ | ||
public static IServiceCollection AddMattermost(this IServiceCollection services) | ||
{ | ||
services.ConfigureByName<MattermostProviderOptions>(); | ||
return services | ||
.AddSingleton<MattermostProvider>(); | ||
|
||
services.AddHttpClient(MattermostAdapter.HttpClientName); | ||
|
||
return services.AddSingleton<MattermostProvider>(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
ATI.Services.Common/Mattermost/MattermostNotificationPayload.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#nullable enable | ||
using JetBrains.Annotations; | ||
|
||
namespace ATI.Services.Common.Mattermost; | ||
|
||
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)] | ||
internal class MattermostNotificationPayload | ||
{ | ||
/// <summary> | ||
/// Id канала | ||
/// </summary> | ||
public required string ChannelId { get; init; } | ||
|
||
/// <summary> | ||
/// Текст сообщения | ||
/// </summary> | ||
public required string Message { get; init; } | ||
|
||
/// <summary> | ||
/// Id корневого сообщения (для отправки в тред) | ||
/// </summary> | ||
public string? RootId { get; init; } | ||
} |
Oops, something went wrong.