diff --git a/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Alias.cs b/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Alias.cs index 71d606a..03fb8b3 100644 --- a/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Alias.cs +++ b/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Alias.cs @@ -62,8 +62,7 @@ public override async Task Execute(Message message, { case "List": await botClient.SendDocumentAsyncFromText(message.Chat.Id, - _aliasManager.ToTable(true, - TableOutputType.Html), + _aliasManager.ToTable(true, TableOutputType.Html), "alias.html"); endCommand = true; break; diff --git a/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Api/Create.cs b/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Api/Create.cs index f665fce..a64c575 100644 --- a/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Api/Create.cs +++ b/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Api/Create.cs @@ -19,6 +19,5 @@ internal class Create : Base public override string Name => "create"; public override string Description => "Get from resource and result to file"; protected override MethodType MethodType => MethodType.Create; - } } \ No newline at end of file diff --git a/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Corsinvest.ProxmoxVE.TelegramBot.Api.csproj b/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Corsinvest.ProxmoxVE.TelegramBot.Api.csproj index 761c033..d68e8da 100644 --- a/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Corsinvest.ProxmoxVE.TelegramBot.Api.csproj +++ b/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Corsinvest.ProxmoxVE.TelegramBot.Api.csproj @@ -3,7 +3,7 @@ netstandard2.0 true - 1.0.0 + 1.1.0 Corsinvest Srl Daniele Corsini Corsinvest Srl @@ -29,8 +29,8 @@ - + - + \ No newline at end of file diff --git a/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Helpers/PveHelper.cs b/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Helpers/PveHelper.cs index d8be623..8d555cd 100644 --- a/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Helpers/PveHelper.cs +++ b/src/Corsinvest.ProxmoxVE.TelegramBot.Api/Helpers/PveHelper.cs @@ -29,7 +29,6 @@ internal static class PveHelper public static ClassApi GetClassApiRoot(PveClient client) => _classApiRoot ?? (_classApiRoot = GeneretorClassApi.Generate(client.Hostname, client.Port)); - public static PveClient GetClient() { var client = ClientHelper.GetClientFromHA(HostandPortHA, Out); diff --git a/src/Corsinvest.ProxmoxVE.TelegramBot/Corsinvest.ProxmoxVE.TelegramBot.csproj b/src/Corsinvest.ProxmoxVE.TelegramBot/Corsinvest.ProxmoxVE.TelegramBot.csproj index a41bddf..aa80a70 100644 --- a/src/Corsinvest.ProxmoxVE.TelegramBot/Corsinvest.ProxmoxVE.TelegramBot.csproj +++ b/src/Corsinvest.ProxmoxVE.TelegramBot/Corsinvest.ProxmoxVE.TelegramBot.csproj @@ -1,7 +1,7 @@ Exe - 1.2.1 + 1.3.0 netcoreapp3.0 cv4pve-botgram Corsinvest Srl @@ -20,9 +20,9 @@ - + - + diff --git a/src/Corsinvest.ProxmoxVE.TelegramBot/Program.cs b/src/Corsinvest.ProxmoxVE.TelegramBot/Program.cs index ac0bf60..677cb39 100644 --- a/src/Corsinvest.ProxmoxVE.TelegramBot/Program.cs +++ b/src/Corsinvest.ProxmoxVE.TelegramBot/Program.cs @@ -28,18 +28,18 @@ static void Main(string[] args) app.OnExecute(() => { - var host = app.GetOption(CommandOptionExtension.HOST_OPTION_NAME, true).Value(); - var username = app.GetOption(CommandOptionExtension.USERNAME_OPTION_NAME, true).Value(); - - var botManager = new BotManager(host, - username, - app.GetOption(CommandOptionExtension.PASSWORD_OPTION_NAME, true).Value(), + var botManager = new BotManager(app.GetHost().Value(), + app.GetUsername().Value(), + app.GetPasswordFromOption(), optToken.Value(), app.Out); botManager.StartReceiving(); Console.ReadLine(); - // botManager.StopReceiving(); + + try { botManager.StopReceiving(); } + catch { } + app.Out.WriteLine("End application"); });