incrementedd version
This commit is contained in:
@@ -3,11 +3,7 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Telegram.Bot;
|
||||
using Telegrator;
|
||||
using Telegrator.Core;
|
||||
using Telegrator.Providers;
|
||||
|
||||
#pragma warning disable IDE0001
|
||||
namespace Telegrator.Hosting.Web
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
||||
|
||||
<Title>Telegrator.Hosting.Web</Title>
|
||||
<Version>1.16.0</Version>
|
||||
<Version>1.16.1</Version>
|
||||
<Authors>Rikitav Tim4ik</Authors>
|
||||
<Company>Rikitav Tim4ik</Company>
|
||||
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
||||
@@ -25,22 +25,19 @@
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\..\LICENSE" Pack="True" PackagePath="\" />
|
||||
<None Include="..\..\README.md" Pack="True" PackagePath="\" />
|
||||
<None Include="..\..\resources\telegrator_nuget.png" Pack="True" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Telegrator.Hosting\Telegrator.Hosting.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Telegram.Bot.AspNetCore" Version="22.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Telegram.Bot.AspNetCore" Version="22.5.0" />
|
||||
<None Include=".\README.md" Pack="True" PackagePath="\" />
|
||||
<None Include="..\..\LICENSE" Pack="True" PackagePath="\" />
|
||||
<None Include="..\..\resources\telegrator_nuget.png" Pack="True" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
||||
|
||||
<Title>Telegrator.Hosting</Title>
|
||||
<Version>1.16.0</Version>
|
||||
<Version>1.16.1</Version>
|
||||
<Authors>Rikitav Tim4ik</Authors>
|
||||
<Company>Rikitav Tim4ik</Company>
|
||||
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
||||
@@ -26,19 +26,19 @@
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Telegrator\Telegrator.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include=".\README.md" Pack="True" PackagePath="\" />
|
||||
<None Include="..\..\LICENSE" Pack="True" PackagePath="\" />
|
||||
<None Include="..\..\README.md" Pack="True" PackagePath="\" />
|
||||
<None Include="..\..\resources\telegrator_nuget.png" Pack="True" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Telegrator\Telegrator.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Types;
|
||||
using Telegrator.Core;
|
||||
using Telegrator.Core.Filters;
|
||||
using Telegrator.Core.Handlers;
|
||||
|
||||
|
||||
@@ -98,6 +98,11 @@ namespace Telegrator.Mediation
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>A task representing the asynchronous update handling operation.</returns>
|
||||
public virtual async Task HandleUpdateAsync(ITelegramBotClient botClient, Update update, CancellationToken cancellationToken)
|
||||
{
|
||||
_ = HandleUpdateAsyncInternal(botClient, update, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task HandleUpdateAsyncInternal(ITelegramBotClient botClient, Update update, CancellationToken cancellationToken)
|
||||
{
|
||||
// Logging
|
||||
LogUpdate(update);
|
||||
@@ -135,7 +140,28 @@ namespace Telegrator.Mediation
|
||||
}
|
||||
|
||||
// Queuing reagular handlers for execution
|
||||
await HandlersPool.Enqueue(GetHandlers(HandlersProvider, botClient, update, cancellationToken));
|
||||
foreach (DescribedHandlerDescriptor handlerInfo in GetHandlers(HandlersProvider, botClient, update, cancellationToken))
|
||||
{
|
||||
if (lastResult?.NextType != null)
|
||||
{
|
||||
if (lastResult.NextType != handlerInfo.From.HandlerType)
|
||||
continue;
|
||||
}
|
||||
|
||||
// Enqueuing found handlers
|
||||
await HandlersPool.Enqueue(handlerInfo);
|
||||
await handlerInfo.AwaitResult(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
lastResult = handlerInfo.Result;
|
||||
if (lastResult == null)
|
||||
break; // Smth went horribly wrong, better to stop routing
|
||||
|
||||
if (lastResult != null && !lastResult.RouteNext)
|
||||
break;
|
||||
|
||||
TelegratorLogging.LogTrace("Handler '{0}' requested route continuation (Update {1})", handlerInfo.DisplayString, handlerInfo.HandlingUpdate.Id);
|
||||
}
|
||||
|
||||
TelegratorLogging.LogTrace("Receiving Update ({0}) finished", update.Id);
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
||||
|
||||
<Title>Telegrator : Telegram.Bot mediator framework</Title>
|
||||
<Version>1.16.0</Version>
|
||||
<Version>1.16.1</Version>
|
||||
<Authors>Rikitav Tim4ik</Authors>
|
||||
<Company>Rikitav Tim4ik</Company>
|
||||
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
||||
|
||||
Reference in New Issue
Block a user