-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
18 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
HeyBoxChatBotCs.Api/ServerMessageHandler/DataConverters/IDataConverter.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,6 @@ | ||
namespace HeyBoxChatBotCs.Api.ServerMessageHandler.DataConverters; | ||
|
||
public interface IDataConverter | ||
{ | ||
public Task<object?> ConverterAsync(string message); | ||
} |
13 changes: 13 additions & 0 deletions
13
HeyBoxChatBotCs.Api/ServerMessageHandler/DataConverters/UserSendCommandConverter.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,13 @@ | ||
using System.Text.Json; | ||
using HeyBoxChatBotCs.Api.ServerMessageHandler.ServerMessageData; | ||
using HeyBoxChatBotCs.Api.ServerMessageHandler.System; | ||
|
||
namespace HeyBoxChatBotCs.Api.ServerMessageHandler.DataConverters; | ||
|
||
public class UserSendCommandConverter : IDataConverter | ||
{ | ||
public Task<object?> ConverterAsync(string message) | ||
{ | ||
return Task.FromResult<object?>(JsonSerializer.Deserialize<ServerMessage<UserSendCommandData>>(message)); | ||
} | ||
} |
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