Files
Govor/Govor.ConsoleClient/Commands/SendMessageCommand.cs
T
Artemy f524a9f0b7 Refactor console client to new Govor.ConsoleClient project
Removed Govor.Console implementation and introduced a new Govor.ConsoleClient project with a modular command-based architecture. Added dependency injection, command dispatcher, middleware pipeline, logging, and interactive command support. Updated solution and project files to reflect the new structure.
2025-07-19 19:08:21 +07:00

44 lines
1.1 KiB
C#

using Govor.ConsoleClient.Services;
namespace Govor.ConsoleClient.Commands;
[CommandRoute("/send")]
public class SendMessageCommand : IInteractiveCommand
{
private string? _recipient;
private bool _isCompleted;
public bool IsCompleted => _isCompleted;
public Task ExecuteAsync(CommandContext context)
{
Console.WriteLine("Кому вы хотите отправить сообщение?");
return Task.CompletedTask;
}
public async Task HandleInputAsync(string input)
{
if (_recipient == null)
{
_recipient = input;
Console.WriteLine("Введите сообщение:");
}
else
{
var message = input;
Console.WriteLine($"(Отправка '{message}' пользователю '{_recipient}')");
_isCompleted = true;
}
await Task.CompletedTask;
}
public string LongHelp()
{
throw new NotImplementedException();
}
public string ShortHelp()
{
throw new NotImplementedException();
}
}