Skip to content

Commit

Permalink
Improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
franklupo committed Apr 16, 2020
1 parent db8683f commit 1fe8008
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/Corsinvest.ProxmoxVE.TelegramBot.Api/Commands/Alias.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ public override async Task<bool> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>

<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Company>Corsinvest Srl</Company>
<Authors>Daniele Corsini</Authors>
<Copyright>Corsinvest Srl</Copyright>
Expand All @@ -29,8 +29,8 @@

<ItemGroup>
<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Extension\Corsinvest.ProxmoxVE.Api.Extension.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Extension" Version="2.2.2" />
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Extension" Version="2.3.0" />

<PackageReference Include="Telegram.Bot" Version="15.2.1" />
<PackageReference Include="Telegram.Bot" Version="15.5.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<Version>1.2.1</Version>
<Version>1.3.0</Version>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AssemblyName>cv4pve-botgram</AssemblyName>
<Company>Corsinvest Srl</Company>
Expand All @@ -20,9 +20,9 @@
<TrimmerRootAssembly Include="System.Net.WebClient" />

<!-- <ProjectReference Include="..\..\..\cv4pve-api-dotnet\src\Corsinvest.ProxmoxVE.Api.Shell\Corsinvest.ProxmoxVE.Api.Shell.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="1.1.0" />
<PackageReference Include="Corsinvest.ProxmoxVE.Api.Shell" Version="2.3.0" />

<!-- <ProjectReference Include="..\Corsinvest.ProxmoxVE.TelegramBot.Api\Corsinvest.ProxmoxVE.TelegramBot.Api.csproj" /> -->
<PackageReference Include="Corsinvest.ProxmoxVE.TelegramBot.Api" Version="1.0.0" />
<PackageReference Include="Corsinvest.ProxmoxVE.TelegramBot.Api" Version="1.1.0" />
</ItemGroup>
</Project>
14 changes: 7 additions & 7 deletions src/Corsinvest.ProxmoxVE.TelegramBot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});

Expand Down

0 comments on commit 1fe8008

Please sign in to comment.