* Architectural rework

This commit is contained in:
2026-03-06 23:19:24 +04:00
parent 74d778e6da
commit 866129f2ff
144 changed files with 413 additions and 368 deletions
+6 -6
View File
@@ -1,9 +1,9 @@
<Solution> <Solution>
<Project Path="src/Telegrator/Telegrator.csproj" />
<Project Path="src/Telegrator.Analyzers/Telegrator.Analyzers.csproj" />
<Project Path="src/Telegrator.Hosting/Telegrator.Hosting.csproj" />
<Project Path="src/Telegrator.Hosting.Web/Telegrator.Hosting.Web.csproj" />
<Project Path="src/Telegrator.Localized/Telegrator.Localized.csproj" />
<Project Path="dev/Telegrator.RoslynGenerators/Telegrator.RoslynGenerators.csproj" /> <Project Path="dev/Telegrator.RoslynGenerators/Telegrator.RoslynGenerators.csproj" />
<Project Path="src/Telegrator.Analyzers/Telegrator.Analyzers.csproj" />
<Project Path="src/Telegrator.Hosting.Web/Telegrator.Hosting.Web.csproj" />
<Project Path="src/Telegrator.Hosting/Telegrator.Hosting.csproj" />
<Project Path="src/Telegrator.Localized/Telegrator.Localized.csproj" />
<Project Path="src/Telegrator/Telegrator.csproj" />
<Project Path="tests/Telegrator.Tests/Telegrator.Tests.csproj" /> <Project Path="tests/Telegrator.Tests/Telegrator.Tests.csproj" />
</Solution> </Solution>
@@ -1,8 +1,7 @@
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Telegrator.Hosting.Components;
namespace Telegrator.Hosting.Web.Components namespace Telegrator.Hosting.Web
{ {
/// <summary> /// <summary>
/// Interface for Telegram bot hosts with Webhook update receiving. /// Interface for Telegram bot hosts with Webhook update receiving.
@@ -5,9 +5,7 @@ using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Telegrator.Hosting.Components; using Telegrator.Core;
using Telegrator.Hosting.Web.Components;
using Telegrator.MadiatorCore;
namespace Telegrator.Hosting.Web namespace Telegrator.Hosting.Web
{ {
@@ -5,11 +5,10 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Telegram.Bot; using Telegram.Bot;
using Telegrator.Hosting.Components; using Telegrator;
using Telegrator.Core;
using Telegrator.Hosting.Configuration; using Telegrator.Hosting.Configuration;
using Telegrator.Hosting.Providers; using Telegrator.Providers;
using Telegrator.Hosting.Providers.Components;
using Telegrator.MadiatorCore;
#pragma warning disable IDE0001 #pragma warning disable IDE0001
namespace Telegrator.Hosting.Web namespace Telegrator.Hosting.Web
@@ -7,9 +7,10 @@ using Microsoft.Extensions.Primitives;
using System.Text.Json; using System.Text.Json;
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.MadiatorCore; using Telegrator.Core;
using Telegrator.Hosting.Web;
namespace Telegrator.Hosting.Web.Polling namespace Telegrator.Mediation
{ {
/// <summary> /// <summary>
/// Service for receiving updates for Hosted telegram bots via Webhooks /// Service for receiving updates for Hosted telegram bots via Webhooks
@@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<RootNamespace>Telegrator</RootNamespace>
<BaseOutputPath>..\..\bin</BaseOutputPath> <BaseOutputPath>..\..\bin</BaseOutputPath>
<DocumentationFile>..\..\docs\$(AssemblyName).xml</DocumentationFile> <DocumentationFile>..\..\docs\$(AssemblyName).xml</DocumentationFile>
@@ -6,14 +6,13 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System.Diagnostics; using System.Diagnostics;
using Telegram.Bot; using Telegram.Bot;
using Telegrator.Configuration; using Telegrator;
using Telegrator.Hosting.Providers; using Telegrator.Core;
using Telegrator.Hosting.Providers.Components; using Telegrator.Hosting.Web;
using Telegrator.Hosting.Web.Components; using Telegrator.Mediation;
using Telegrator.Hosting.Web.Polling; using Telegrator.Providers;
using Telegrator.MadiatorCore;
namespace Telegrator.Hosting.Web namespace Telegrator
{ {
/// <summary> /// <summary>
/// Contains extensions for <see cref="IServiceCollection"/> /// Contains extensions for <see cref="IServiceCollection"/>
@@ -2,7 +2,7 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace Telegrator.Hosting.Configuration namespace Telegrator
{ {
/// <summary> /// <summary>
/// Abstract base class for configuring options from configuration sources. /// Abstract base class for configuring options from configuration sources.
@@ -1,6 +1,6 @@
using Telegrator.MadiatorCore; using Telegrator.Providers;
namespace Telegrator.Hosting.Providers.Components namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Collection class for managing handler descriptors organized by update type for host apps. /// Collection class for managing handler descriptors organized by update type for host apps.
@@ -1,4 +1,6 @@
namespace Telegrator.Hosting.Components using Telegrator.Hosting;
namespace Telegrator.Handlers
{ {
/// <summary> /// <summary>
/// Interface for pre-building routines that can be executed during host construction. /// Interface for pre-building routines that can be executed during host construction.
@@ -1,7 +1,7 @@
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Configuration; using Telegrator.Core;
namespace Telegrator.Hosting namespace Telegrator.Hosting
{ {
@@ -1,7 +1,6 @@
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Telegrator;
namespace Telegrator.Hosting.Components namespace Telegrator.Hosting
{ {
/// <summary> /// <summary>
/// Interface for Telegram bot hosts. /// Interface for Telegram bot hosts.
@@ -1,9 +1,9 @@
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Telegrator.MadiatorCore; using Telegrator.Core;
namespace Telegrator.Hosting.Components namespace Telegrator.Hosting
{ {
/// <summary> /// <summary>
/// Interface for building Telegram bot hosts with dependency injection support. /// Interface for building Telegram bot hosts with dependency injection support.
@@ -1,8 +1,7 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Telegrator.Hosting.Components; using Telegrator.Core;
using Telegrator.MadiatorCore;
namespace Telegrator.Hosting namespace Telegrator.Hosting
{ {
@@ -2,9 +2,8 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Telegrator.Hosting.Components; using Telegrator.Core;
using Telegrator.Hosting.Providers; using Telegrator.Hosting.Providers;
using Telegrator.MadiatorCore;
#pragma warning disable IDE0001 #pragma warning disable IDE0001
namespace Telegrator.Hosting namespace Telegrator.Hosting
@@ -1,7 +1,6 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Telegrator.Logging;
namespace Telegrator.Hosting.Logging namespace Telegrator.Logging
{ {
/// <summary> /// <summary>
/// Adapter for Microsoft.Extensions.Logging to work with Telegrator logging system. /// Adapter for Microsoft.Extensions.Logging to work with Telegrator logging system.
@@ -21,7 +20,7 @@ namespace Telegrator.Hosting.Logging
} }
/// <inheritdoc/> /// <inheritdoc/>
public void Log(Telegrator.Logging.LogLevel level, string message, Exception? exception = null) public void Log(LogLevel level, string message, Exception? exception = null)
{ {
var msLogLevel = level switch var msLogLevel = level switch
{ {
@@ -1,8 +1,8 @@
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Telegrator.MadiatorCore; using Telegrator.Core;
using Telegrator.Polling; using Telegrator.Mediation;
namespace Telegrator.Hosting.Polling namespace Telegrator.Polling
{ {
/// <inheritdoc/> /// <inheritdoc/>
public class HostUpdateHandlersPool(IUpdateRouter router, IOptions<TelegratorOptions> options) public class HostUpdateHandlersPool(IUpdateRouter router, IOptions<TelegratorOptions> options)
@@ -3,11 +3,10 @@ using Microsoft.Extensions.Options;
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Polling; using Telegram.Bot.Polling;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Configuration; using Telegrator.Core;
using Telegrator.MadiatorCore; using Telegrator.Mediation;
using Telegrator.Polling;
namespace Telegrator.Hosting.Polling namespace Telegrator.Polling
{ {
/// <inheritdoc/> /// <inheritdoc/>
public class HostUpdateRouter : UpdateRouter public class HostUpdateRouter : UpdateRouter
@@ -3,11 +3,11 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Polling; using Telegram.Bot.Polling;
using Telegrator.Hosting.Components; using Telegrator.Core;
using Telegrator.MadiatorCore; using Telegrator.Hosting;
using Telegrator.Polling; using Telegrator.Mediation;
namespace Telegrator.Hosting.Polling namespace Telegrator.Polling
{ {
/// <summary> /// <summary>
/// Service for receiving updates for Hosted telegram bots /// Service for receiving updates for Hosted telegram bots
@@ -1,8 +1,7 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Telegrator.Providers;
namespace Telegrator.Hosting.Providers namespace Telegrator.Providers
{ {
/// <inheritdoc/> /// <inheritdoc/>
public class HostAwaitingProvider(IOptions<TelegratorOptions> options, ILogger<HostAwaitingProvider> logger) : AwaitingProvider(options.Value) public class HostAwaitingProvider(IOptions<TelegratorOptions> options, ILogger<HostAwaitingProvider> logger) : AwaitingProvider(options.Value)
@@ -1,13 +1,11 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using System.Reflection; using System.Reflection;
using Telegrator.Configuration; using Telegrator.Configuration;
using Telegrator.Hosting.Components; using Telegrator.Core;
using Telegrator.Hosting.Providers.Components; using Telegrator.Core.Descriptors;
using Telegrator.MadiatorCore; using Telegrator.Hosting;
using Telegrator.MadiatorCore.Descriptors;
using Telegrator.Providers;
namespace Telegrator.Hosting.Providers namespace Telegrator.Providers
{ {
/// <summary> /// <summary>
/// Pre host building task /// Pre host building task
@@ -16,7 +14,7 @@ namespace Telegrator.Hosting.Providers
public delegate void PreBuildingRoutine(ITelegramBotHostBuilder builder); public delegate void PreBuildingRoutine(ITelegramBotHostBuilder builder);
/// <inheritdoc/> /// <inheritdoc/>
public class HostHandlersCollection(IServiceCollection hostServiceColletion, ITelegratorOptions options) : HandlersCollection(options), IHostHandlersCollection public class HostHandlersCollection(IServiceCollection hostServiceColletion, TelegratorOptions options) : HandlersCollection(options), IHostHandlersCollection
{ {
private readonly IServiceCollection Services = hostServiceColletion; private readonly IServiceCollection Services = hostServiceColletion;
@@ -1,12 +1,11 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Telegrator.Handlers.Components; using Telegrator.Core;
using Telegrator.MadiatorCore; using Telegrator.Core.Descriptors;
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Core.Handlers;
using Telegrator.Providers;
namespace Telegrator.Hosting.Providers namespace Telegrator.Providers
{ {
/// <inheritdoc/> /// <inheritdoc/>
public class HostHandlersProvider : HandlersProvider public class HostHandlersProvider : HandlersProvider
@@ -1,6 +1,6 @@
using Telegram.Bot; using Telegram.Bot;
namespace Telegrator.Hosting.Configuration namespace Telegrator
{ {
/// <summary> /// <summary>
/// Internal proxy class for configuring Telegram bot client options from configuration. /// Internal proxy class for configuring Telegram bot client options from configuration.
@@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<RootNamespace>Telegrator</RootNamespace>
<BaseOutputPath>..\..\bin</BaseOutputPath> <BaseOutputPath>..\..\bin</BaseOutputPath>
<DocumentationFile>..\..\docs\$(AssemblyName).xml</DocumentationFile> <DocumentationFile>..\..\docs\$(AssemblyName).xml</DocumentationFile>
+9 -10
View File
@@ -12,18 +12,17 @@ using Telegram.Bot;
using Telegram.Bot.Polling; using Telegram.Bot.Polling;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Configuration; using Telegrator;
using Telegrator.Hosting.Components; using Telegrator.Core;
using Telegrator.Core.Descriptors;
using Telegrator.Handlers;
using Telegrator.Hosting;
using Telegrator.Hosting.Configuration; using Telegrator.Hosting.Configuration;
using Telegrator.Hosting.Logging;
using Telegrator.Hosting.Polling;
using Telegrator.Hosting.Providers;
using Telegrator.Hosting.Providers.Components;
using Telegrator.Logging; using Telegrator.Logging;
using Telegrator.MadiatorCore; using Telegrator.Polling;
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Providers;
namespace Telegrator.Hosting namespace Telegrator
{ {
public static class HostBuilderExtensions public static class HostBuilderExtensions
{ {
@@ -196,7 +195,7 @@ namespace Telegrator.Hosting
ILogger logger = loggerFactory.CreateLogger("Telegrator"); ILogger logger = loggerFactory.CreateLogger("Telegrator");
MicrosoftLoggingAdapter adapter = new MicrosoftLoggingAdapter(logger); MicrosoftLoggingAdapter adapter = new MicrosoftLoggingAdapter(logger);
Alligator.AddAdapter(adapter); TelegratorLogging.AddAdapter(adapter);
return host; return host;
} }
} }
@@ -1,6 +1,6 @@
using Microsoft.Extensions.Localization; using Microsoft.Extensions.Localization;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Handlers.Components; using Telegrator.Core.Handlers;
namespace Telegrator.Localized namespace Telegrator.Localized
{ {
@@ -1,8 +1,8 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Attributes; using Telegrator.Attributes;
using Telegrator.Core.Filters;
using Telegrator.Filters; using Telegrator.Filters;
using Telegrator.Filters.Components;
namespace Telegrator.Annotations namespace Telegrator.Annotations
{ {
@@ -2,7 +2,7 @@
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Filters; using Telegrator.Filters;
using Telegrator.Attributes; using Telegrator.Attributes;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Annotations namespace Telegrator.Annotations
{ {
@@ -3,7 +3,7 @@ using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Filters; using Telegrator.Filters;
using Telegrator.Attributes; using Telegrator.Attributes;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Annotations namespace Telegrator.Annotations
{ {
@@ -1,6 +1,6 @@
using Telegrator.StateKeeping; using Telegrator.StateKeeping;
using Telegrator.Attributes; using Telegrator.Attributes;
using Telegrator.StateKeeping.Components; using Telegrator.Core.StateKeeping;
namespace Telegrator.Annotations.StateKeeping namespace Telegrator.Annotations.StateKeeping
{ {
@@ -1,6 +1,6 @@
using Telegrator.StateKeeping; using Telegrator.StateKeeping;
using Telegrator.Attributes; using Telegrator.Attributes;
using Telegrator.StateKeeping.Components; using Telegrator.Core.StateKeeping;
namespace Telegrator.Annotations.StateKeeping namespace Telegrator.Annotations.StateKeeping
{ {
@@ -1,6 +1,6 @@
using Telegrator.StateKeeping; using Telegrator.StateKeeping;
using Telegrator.Attributes; using Telegrator.Attributes;
using Telegrator.StateKeeping.Components; using Telegrator.Core.StateKeeping;
namespace Telegrator.Annotations.StateKeeping namespace Telegrator.Annotations.StateKeeping
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
using Telegrator.Handlers.Components; using Telegrator.Core.Handlers;
namespace Telegrator.Aspects namespace Telegrator.Aspects
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
using Telegrator.Handlers.Components; using Telegrator.Core.Handlers;
namespace Telegrator.Aspects namespace Telegrator.Aspects
{ {
@@ -1,7 +1,7 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Core.Filters;
using Telegrator.Filters; using Telegrator.Filters;
using Telegrator.Filters.Components;
namespace Telegrator.Attributes namespace Telegrator.Attributes
{ {
@@ -1,8 +1,8 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Annotations.StateKeeping; using Telegrator.Annotations.StateKeeping;
using Telegrator.Attributes.Components; using Telegrator.Core.Attributes;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.StateKeeping.Components; using Telegrator.Core.StateKeeping;
namespace Telegrator.Attributes namespace Telegrator.Attributes
{ {
@@ -1,7 +1,7 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Attributes.Components; using Telegrator.Core.Attributes;
using Telegrator.Core.Filters;
using Telegrator.Filters; using Telegrator.Filters;
using Telegrator.Filters.Components;
namespace Telegrator.Attributes namespace Telegrator.Attributes
{ {
@@ -1,6 +1,6 @@
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Attributes.Components; using Telegrator.Core.Attributes;
using Telegrator.Handlers.Components; using Telegrator.Core.Handlers;
namespace Telegrator.Attributes namespace Telegrator.Attributes
{ {
@@ -1,29 +0,0 @@
namespace Telegrator.Configuration
{
/// <summary>
/// Interface for configuring Telegram bot behavior and execution settings.
/// Controls various aspects of bot operation including concurrency, routing, collecting, and execution policies.
/// </summary>
public interface ITelegratorOptions
{
/// <summary>
/// Gets or sets the maximum number of parallel working handlers. Null means no limit.
/// </summary>
public int? MaximumParallelWorkingHandlers { get; set; }
/// <summary>
/// Gets or sets a value indicating whether awaiting handlers should be routed separately from regular handlers.
/// </summary>
public bool ExclusiveAwaitingHandlerRouting { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to exclude intersecting command aliases.
/// </summary>
public bool ExceptIntersectingCommandAliases { get; set; }
/// <summary>
/// Gets or sets the global cancellation token for all bot operations.
/// </summary>
public CancellationToken GlobalCancellationToken { get; set; }
}
}
+89
View File
@@ -0,0 +1,89 @@
using Telegram.Bot;
using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums;
using Telegrator.Logging;
namespace Telegrator;
public class ContinuousAction : IDisposable
{
private readonly ITelegramBotClient _client;
private readonly ChatAction _action;
private readonly ChatId _chat;
private readonly TimeSpan _delay;
private readonly CancellationTokenSource _linkedCts;
private readonly Task _workerTask;
private int _disposed;
public ContinuousAction(ITelegramBotClient client, ChatId chat, ChatAction action, TimeSpan? delay = null, CancellationToken cancellationToken = default)
{
_client = client;
_chat = chat;
_action = action;
_delay = delay ?? TimeSpan.FromSeconds(4);
_linkedCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
_workerTask = StartActorAsync(_linkedCts.Token);
}
private async Task StartActorAsync(CancellationToken token)
{
try
{
while (!token.IsCancellationRequested)
{
try
{
await _client.SendChatAction(_chat, _action, cancellationToken: token).ConfigureAwait(false);
}
catch (Exception ex) when (ex is not OperationCanceledException)
{
TelegratorLogging.LogTrace("Continuous action throwed an exception.\n{0}", ex);
}
await Task.Delay(_delay, token);
}
}
catch (OperationCanceledException)
{
TelegratorLogging.LogTrace("Continuous action cancelled");
}
}
public void Cancel()
{
if (Interlocked.CompareExchange(ref _disposed, 0, 0) == 0)
{
try
{
_linkedCts.Cancel();
}
catch (ObjectDisposedException)
{
_ = 0xDEADBEEF;
}
}
}
public async Task WaitAsync()
{
await _workerTask.ConfigureAwait(false);
}
public void Dispose()
{
if (Interlocked.Exchange(ref _disposed, 1) == 1)
return;
try
{
_linkedCts.Cancel();
}
finally
{
_linkedCts.Dispose();
}
}
}
@@ -1,9 +1,9 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.Handlers.Components; using Telegrator.Core.Handlers;
using Telegrator.StateKeeping.Components; using Telegrator.Core.StateKeeping;
namespace Telegrator.Attributes.Components namespace Telegrator.Core.Attributes
{ {
/// <summary> /// <summary>
/// Sets the state in which the <see cref="UpdateHandlerBase"/> can be executed /// Sets the state in which the <see cref="UpdateHandlerBase"/> can be executed
@@ -1,10 +1,11 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Attributes;
using Telegrator.Core.Filters;
using Telegrator.Core.Handlers;
using Telegrator.Filters; using Telegrator.Filters;
using Telegrator.Filters.Components;
using Telegrator.Handlers.Components;
namespace Telegrator.Attributes.Components namespace Telegrator.Core.Attributes
{ {
/// <summary> /// <summary>
/// Defines the <see cref="IFilter{T}"/> to <see cref="Update"/> validation for entry into execution of the <see cref="UpdateHandlerBase"/> /// Defines the <see cref="IFilter{T}"/> to <see cref="Update"/> validation for entry into execution of the <see cref="UpdateHandlerBase"/>
@@ -1,10 +1,10 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Filters.Components; using Telegrator.Core.Descriptors;
using Telegrator.Handlers.Components; using Telegrator.Core.Filters;
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Core.Handlers;
namespace Telegrator.Attributes.Components namespace Telegrator.Core.Attributes
{ {
/// <summary> /// <summary>
/// Defines the <see cref="UpdateType"/>'s and validator (<see cref="IFilter{T}"/>) of the <see cref="Update"/> that <see cref="UpdateHandlerBase"/> will process /// Defines the <see cref="UpdateType"/>'s and validator (<see cref="IFilter{T}"/>) of the <see cref="Update"/> that <see cref="UpdateHandlerBase"/> will process
@@ -1,13 +1,13 @@
using System.Reflection; using System.Reflection;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Attributes.Components; using Telegrator.Core.Attributes;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.Core.Handlers;
using Telegrator.Handlers; using Telegrator.Handlers;
using Telegrator.Handlers.Building; using Telegrator.Handlers.Building;
using Telegrator.Handlers.Components;
namespace Telegrator.MadiatorCore.Descriptors namespace Telegrator.Core.Descriptors
{ {
/// <summary> /// <summary>
/// Descriptor for creating handlers from methods /// Descriptor for creating handlers from methods
@@ -1,9 +1,10 @@
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core;
using Telegrator.Handlers.Components; using Telegrator.Core.Filters;
using Telegrator.Core.Handlers;
namespace Telegrator.MadiatorCore.Descriptors namespace Telegrator.Core.Descriptors
{ {
/// <summary> /// <summary>
/// Contains information about a described handler, including its context, client, and execution logic. /// Contains information about a described handler, including its context, client, and execution logic.
@@ -1,7 +1,7 @@
using Telegrator.Aspects; using Telegrator.Aspects;
using Telegrator.Handlers.Components; using Telegrator.Core.Handlers;
namespace Telegrator.MadiatorCore.Descriptors namespace Telegrator.Core.Descriptors
{ {
/// <summary> /// <summary>
/// Manages the execution of pre and post-execution aspects for a handler. /// Manages the execution of pre and post-execution aspects for a handler.
@@ -1,9 +1,9 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.Handlers.Diagnostics; using Telegrator.Handlers.Diagnostics;
using Telegrator.Logging; using Telegrator.Logging;
namespace Telegrator.MadiatorCore.Descriptors namespace Telegrator.Core.Descriptors
{ {
/// <summary> /// <summary>
/// Represents a set of filters for a handler descriptor, including update and state keeper validators. /// Represents a set of filters for a handler descriptor, including update and state keeper validators.
@@ -61,7 +61,7 @@ namespace Telegrator.MadiatorCore.Descriptors
if (!result) if (!result)
{ {
anyErrors = true; anyErrors = true;
Alligator.LogTrace("(E) UpdateValidator filter of '{0}' for Update ({1}) didnt pass!", filterContext.Data["handler_name"], filterContext.Update.Id); TelegratorLogging.LogTrace("(E) UpdateValidator filter of '{0}' for Update ({1}) didnt pass!", filterContext.Data["handler_name"], filterContext.Update.Id);
if (!formReport) if (!formReport)
return Result.Fault(); return Result.Fault();
@@ -84,7 +84,7 @@ namespace Telegrator.MadiatorCore.Descriptors
if (!result) if (!result)
{ {
anyErrors = true; anyErrors = true;
Alligator.LogTrace("(E) StateKeeperValidator filter of '{0}' for Update ({1}) didnt pass!", filterContext.Data["handler_name"], filterContext.Update.Id); TelegratorLogging.LogTrace("(E) StateKeeperValidator filter of '{0}' for Update ({1}) didnt pass!", filterContext.Data["handler_name"], filterContext.Update.Id);
if (!formReport) if (!formReport)
return Result.Fault(); return Result.Fault();
@@ -110,7 +110,7 @@ namespace Telegrator.MadiatorCore.Descriptors
if (!result) if (!result)
{ {
anyErrors = true; anyErrors = true;
Alligator.LogTrace("(E) '{0}' filter of '{1}' for Update ({2}) didnt pass!", filterName, filterContext.Data["handler_name"], filterContext.Update.Id); TelegratorLogging.LogTrace("(E) '{0}' filter of '{1}' for Update ({2}) didnt pass!", filterName, filterContext.Data["handler_name"], filterContext.Update.Id);
if (!formReport) if (!formReport)
return Result.Fault(); return Result.Fault();
@@ -1,6 +1,6 @@
using Telegrator.Attributes.Components; using Telegrator.Core.Attributes;
namespace Telegrator.MadiatorCore.Descriptors namespace Telegrator.Core.Descriptors
{ {
/// <summary> /// <summary>
/// Represents an indexer for handler descriptors, containing importance and priority information. /// Represents an indexer for handler descriptors, containing importance and priority information.
@@ -1,10 +1,10 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Attributes.Components; using Telegrator.Core.Attributes;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.Handlers.Components; using Telegrator.Core.Handlers;
namespace Telegrator.MadiatorCore.Descriptors namespace Telegrator.Core.Descriptors
{ {
/// <summary> /// <summary>
/// Specifies the type of handler descriptor. /// Specifies the type of handler descriptor.
@@ -2,8 +2,9 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Configuration; using Telegrator.Configuration;
using Telegrator.Core;
namespace Telegrator.MadiatorCore.Descriptors namespace Telegrator.Core.Descriptors
{ {
/// <summary> /// <summary>
/// The collection containing the <see cref="HandlerDescriptor"/>'s. Used to route <see cref="Update"/>'s in <see cref="IHandlersProvider"/> /// The collection containing the <see cref="HandlerDescriptor"/>'s. Used to route <see cref="Update"/>'s in <see cref="IHandlersProvider"/>
@@ -12,7 +13,7 @@ namespace Telegrator.MadiatorCore.Descriptors
{ {
private readonly object _lock = new object(); private readonly object _lock = new object();
private readonly SortedList<DescriptorIndexer, HandlerDescriptor> _innerCollection; private readonly SortedList<DescriptorIndexer, HandlerDescriptor> _innerCollection;
private readonly ITelegratorOptions? _options; private readonly TelegratorOptions? _options;
private readonly UpdateType _handlingType; private readonly UpdateType _handlingType;
private int count; private int count;
@@ -54,7 +55,7 @@ namespace Telegrator.MadiatorCore.Descriptors
/// </summary> /// </summary>
/// <param name="updateType">The update type for the handlers.</param> /// <param name="updateType">The update type for the handlers.</param>
/// <param name="options">The collecting options.</param> /// <param name="options">The collecting options.</param>
public HandlerDescriptorList(UpdateType updateType, ITelegratorOptions? options) public HandlerDescriptorList(UpdateType updateType, TelegratorOptions? options)
{ {
_innerCollection = []; _innerCollection = [];
_handlingType = updateType; _handlingType = updateType;
@@ -3,10 +3,10 @@ using System.Reflection;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Aspects; using Telegrator.Aspects;
using Telegrator.Attributes.Components; using Telegrator.Core.Attributes;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.MadiatorCore.Descriptors namespace Telegrator.Core.Descriptors
{ {
/// <summary> /// <summary>
/// Provides methods for inspecting handler types and retrieving their attributes and filters. /// Provides methods for inspecting handler types and retrieving their attributes and filters.
@@ -1,7 +1,8 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters;
using Telegrator.Logging; using Telegrator.Logging;
namespace Telegrator.Filters.Components namespace Telegrator.Core.Filters
{ {
/// <summary> /// <summary>
/// Represents a compiled filter that applies a set of filters to an anonymous target type. /// Represents a compiled filter that applies a set of filters to an anonymous target type.
@@ -77,7 +78,7 @@ namespace Telegrator.Filters.Components
if (!filter.CanPass(context)) if (!filter.CanPass(context))
{ {
if (filter is not AnonymousCompiledFilter && filter is not AnonymousTypeFilter) if (filter is not AnonymousCompiledFilter && filter is not AnonymousTypeFilter)
Alligator.LogDebug("{0} filter of {1} didnt pass! (Compiled anonymous)", filter.GetType().Name, context.Data["handler_name"]); TelegratorLogging.LogDebug("{0} filter of {1} didnt pass! (Compiled anonymous)", filter.GetType().Name, context.Data["handler_name"]);
return false; return false;
} }
@@ -1,7 +1,8 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters;
using Telegrator.Logging; using Telegrator.Logging;
namespace Telegrator.Filters.Components namespace Telegrator.Core.Filters
{ {
/// <summary> /// <summary>
/// Represents a filter that applies a filter action to an anonymous target type extracted from an update. /// Represents a filter that applies a filter action to an anonymous target type extracted from an update.
@@ -76,7 +77,7 @@ namespace Telegrator.Filters.Components
if (!filter.CanPass(context)) if (!filter.CanPass(context))
{ {
if (IgnoreLog.Contains(filter.GetType().MakeGenericType())) if (IgnoreLog.Contains(filter.GetType().MakeGenericType()))
Alligator.LogDebug("{0} filter of {1} didnt pass!", filter.GetType().Name, context.Data["handler_name"]); TelegratorLogging.LogDebug("{0} filter of {1} didnt pass!", filter.GetType().Name, context.Data["handler_name"]);
return false; return false;
} }
@@ -1,6 +1,7 @@
using Telegrator.Logging; using Telegrator.Filters;
using Telegrator.Logging;
namespace Telegrator.Filters.Components namespace Telegrator.Core.Filters
{ {
/// <summary> /// <summary>
/// Represents a filter that composes multiple filters and passes only if all of them pass. /// Represents a filter that composes multiple filters and passes only if all of them pass.
@@ -49,7 +50,7 @@ namespace Telegrator.Filters.Components
if (!filter.CanPass(context)) if (!filter.CanPass(context))
{ {
if (filter is not AnonymousCompiledFilter && filter is not AnonymousTypeFilter) if (filter is not AnonymousCompiledFilter && filter is not AnonymousTypeFilter)
Alligator.LogTrace("{0} filter of {1} didnt pass! (Compiled)", filter.GetType().Name, context.Data["handler_name"]); TelegratorLogging.LogTrace("{0} filter of {1} didnt pass! (Compiled)", filter.GetType().Name, context.Data["handler_name"]);
return false; return false;
} }
@@ -1,6 +1,6 @@
using System.Collections; using System.Collections;
namespace Telegrator.Filters.Components namespace Telegrator.Core.Filters
{ {
/// <summary> /// <summary>
/// The list containing filters worked out during Polling to further obtain additional filtering information /// The list containing filters worked out during Polling to further obtain additional filtering information
@@ -1,8 +1,7 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Configuration;
namespace Telegrator.Filters.Components namespace Telegrator.Core.Filters
{ {
/// <summary> /// <summary>
/// Represents the context for filter execution, including update, input, and additional data. /// Represents the context for filter execution, including update, input, and additional data.
@@ -1,4 +1,4 @@
namespace Telegrator.Filters.Components namespace Telegrator.Core.Filters
{ {
/// <summary> /// <summary>
/// Interface for filters that have a name for identification and debugging purposes. /// Interface for filters that have a name for identification and debugging purposes.
@@ -1,4 +1,4 @@
namespace Telegrator.Filters.Components namespace Telegrator.Core.Filters
{ {
/// <summary> /// <summary>
/// Represents a filter that joins multiple filters together. /// Represents a filter that joins multiple filters together.
@@ -1,11 +1,11 @@
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Filters.Components; using Telegrator.Core.Descriptors;
using Telegrator.MadiatorCore; using Telegrator.Core.Filters;
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Handlers;
namespace Telegrator.Handlers.Components namespace Telegrator.Core.Handlers
{ {
/// <summary> /// <summary>
/// Abstract handler for Telegram updates of type <typeparamref name="TUpdate"/>. /// Abstract handler for Telegram updates of type <typeparamref name="TUpdate"/>.
@@ -1,13 +1,13 @@
using System.Reflection; using System.Reflection;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Attributes.Components; using Telegrator.Core.Attributes;
using Telegrator.Filters.Components; using Telegrator.Core.Descriptors;
using Telegrator.Core.Filters;
using Telegrator.Handlers;
using Telegrator.MadiatorCore; using Telegrator.MadiatorCore;
using Telegrator.MadiatorCore.Descriptors;
using Telegrator.Providers;
namespace Telegrator.Handlers.Components namespace Telegrator.Core.Handlers
{ {
/// <summary> /// <summary>
/// Abstract base class for handlers that support branching execution based on different methods. /// Abstract base class for handlers that support branching execution based on different methods.
@@ -1,13 +1,11 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Annotations.StateKeeping; using Telegrator.Annotations.StateKeeping;
using Telegrator.Filters.Components; using Telegrator.Core.Descriptors;
using Telegrator.Handlers.Components; using Telegrator.Core.Filters;
using Telegrator.MadiatorCore; using Telegrator.Core.StateKeeping;
using Telegrator.MadiatorCore.Descriptors;
using Telegrator.StateKeeping.Components;
namespace Telegrator.Handlers.Building.Components namespace Telegrator.Core.Handlers.Building
{ {
/// <summary> /// <summary>
/// Base class for building handler descriptors and managing handler filters. /// Base class for building handler descriptors and managing handler filters.
@@ -1,6 +1,6 @@
using Telegrator.StateKeeping.Components; using Telegrator.Core.StateKeeping;
namespace Telegrator.Handlers.Building.Components namespace Telegrator.Core.Handlers.Building
{ {
/// <summary> /// <summary>
/// Defines a builder for awaiting handler logic for a specific update type. /// Defines a builder for awaiting handler logic for a specific update type.
@@ -1,9 +1,9 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Annotations.StateKeeping; using Telegrator.Annotations.StateKeeping;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.StateKeeping.Components; using Telegrator.Core.StateKeeping;
namespace Telegrator.Handlers.Building.Components namespace Telegrator.Core.Handlers.Building
{ {
/// <summary> /// <summary>
/// Defines builder actions for configuring handler builders. /// Defines builder actions for configuring handler builders.
@@ -1,7 +1,6 @@
using Telegrator.Handlers.Building; using Telegrator.Handlers.Building;
using Telegrator.MadiatorCore;
namespace Telegrator.Handlers.Building.Components namespace Telegrator.Core.Handlers.Building
{ {
/// <summary> /// <summary>
/// Defines a builder for regular handler logic for a specific update type. /// Defines a builder for regular handler logic for a specific update type.
@@ -1,10 +1,10 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Annotations.StateKeeping; using Telegrator.Annotations.StateKeeping;
using Telegrator.Core.Filters;
using Telegrator.Core.StateKeeping;
using Telegrator.Filters; using Telegrator.Filters;
using Telegrator.Filters.Components;
using Telegrator.StateKeeping.Components;
namespace Telegrator.Handlers.Building.Components namespace Telegrator.Core.Handlers.Building
{ {
/// <summary> /// <summary>
/// Filter for state keeping logic, allowing filtering based on state and special state conditions. /// Filter for state keeping logic, allowing filtering based on state and special state conditions.
@@ -1,7 +1,7 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Handlers.Building.Components namespace Telegrator.Core.Handlers.Building
{ {
/// <summary> /// <summary>
/// Delegate for validating an update in a filter context. /// Delegate for validating an update in a filter context.
@@ -1,9 +1,8 @@
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.MadiatorCore;
namespace Telegrator.Handlers.Components namespace Telegrator.Core.Handlers
{ {
/// <summary> /// <summary>
/// Represents an empty handler container that throws <see cref="NotImplementedException"/> for all members. /// Represents an empty handler container that throws <see cref="NotImplementedException"/> for all members.
@@ -1,4 +1,4 @@
namespace Telegrator.Handlers.Components namespace Telegrator.Core.Handlers
{ {
/// <summary> /// <summary>
/// Represents a token that tracks the lifetime of a handler instance. /// Represents a token that tracks the lifetime of a handler instance.
@@ -1,4 +1,6 @@
namespace Telegrator.Handlers.Components; using Telegrator.Handlers;
namespace Telegrator.Core.Handlers;
/// <summary> /// <summary>
/// Abstract handler for Telegram updates of type <typeparamref name="TUpdate"/>. /// Abstract handler for Telegram updates of type <typeparamref name="TUpdate"/>.
@@ -1,9 +1,8 @@
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.MadiatorCore;
namespace Telegrator.Handlers.Components namespace Telegrator.Core.Handlers
{ {
/// <summary> /// <summary>
/// Interface for handler containers that provide context and resources for update handlers. /// Interface for handler containers that provide context and resources for update handlers.
@@ -1,7 +1,7 @@
using Telegrator.MadiatorCore; using Telegrator.Core.Descriptors;
using Telegrator.MadiatorCore.Descriptors; using Telegrator.MadiatorCore;
namespace Telegrator.Handlers.Components namespace Telegrator.Core.Handlers
{ {
/// <summary> /// <summary>
/// Factory interface for creating handler containers. /// Factory interface for creating handler containers.
@@ -1,9 +1,9 @@
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Core.Descriptors;
using Telegrator.Handlers.Diagnostics; using Telegrator.Handlers.Diagnostics;
using Telegrator.MadiatorCore.Descriptors;
namespace Telegrator.Handlers.Components; namespace Telegrator.Core.Handlers;
/// <summary> /// <summary>
/// Abstraction for update handlers, providing execution and lifetime management for Telegram updates. /// Abstraction for update handlers, providing execution and lifetime management for Telegram updates.
@@ -1,10 +1,10 @@
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Polling; using Telegram.Bot.Polling;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Core.Descriptors;
using Telegrator.Handlers.Diagnostics; using Telegrator.Handlers.Diagnostics;
using Telegrator.MadiatorCore.Descriptors;
namespace Telegrator.Handlers.Components namespace Telegrator.Core.Handlers
{ {
/// <summary> /// <summary>
/// Base class for update handlers, providing execution and lifetime management for Telegram updates. /// Base class for update handlers, providing execution and lifetime management for Telegram updates.
@@ -1,6 +1,6 @@
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Core.Descriptors;
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Provider for managing awaiting handlers that can wait for specific update types. /// Provider for managing awaiting handlers that can wait for specific update types.
@@ -1,4 +1,4 @@
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Interface for providers that collect and manage handler collections. /// Interface for providers that collect and manage handler collections.
@@ -1,6 +1,6 @@
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Core.Descriptors;
namespace Telegrator.Providers namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Interface for classes that can provide custom handler descriptors. /// Interface for classes that can provide custom handler descriptors.
@@ -1,7 +1,7 @@
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Core.Descriptors;
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Collection class for managing handler descriptors organized by update type. /// Collection class for managing handler descriptors organized by update type.
@@ -1,4 +1,4 @@
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Combines <see cref="IHandlersCollection"/> and <see cref="IHandlersProvider"/>. /// Combines <see cref="IHandlersCollection"/> and <see cref="IHandlersProvider"/>.
@@ -1,8 +1,8 @@
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Handlers.Components; using Telegrator.Core.Descriptors;
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Core.Handlers;
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Provides methods to retrieve and describe handler information for updates. /// Provides methods to retrieve and describe handler information for updates.
@@ -1,4 +1,4 @@
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Interface for polling providers that manage both regular and awaiting handlers. /// Interface for polling providers that manage both regular and awaiting handlers.
@@ -1,7 +1,7 @@
using Telegram.Bot; using Telegram.Bot;
using Telegram.Bot.Polling; using Telegram.Bot.Polling;
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Interface for handling exceptions that occur during update routing operations. /// Interface for handling exceptions that occur during update routing operations.
@@ -1,6 +1,6 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
namespace Telegrator.Configuration namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Interface for providing bot information and metadata. /// Interface for providing bot information and metadata.
@@ -1,6 +1,6 @@
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Core.Descriptors;
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Represents a delegate for when a handler is enqueued. /// Represents a delegate for when a handler is enqueued.
@@ -1,7 +1,7 @@
using Telegram.Bot.Polling; using Telegram.Bot.Polling;
using Telegram.Bot.Types; using Telegram.Bot.Types;
namespace Telegrator.Polling; namespace Telegrator.Core;
/// <summary> /// <summary>
/// Requests new <see cref="Update"/>s and processes them using provided <see cref="IUpdateHandler"/> instance< /// Requests new <see cref="Update"/>s and processes them using provided <see cref="IUpdateHandler"/> instance<
@@ -1,7 +1,7 @@
using Telegram.Bot.Polling; using Telegram.Bot.Polling;
using Telegrator.Handlers.Components; using Telegrator.Core.Handlers;
namespace Telegrator.MadiatorCore namespace Telegrator.Core
{ {
/// <summary> /// <summary>
/// Interface for update routers that handle incoming updates and manage handler execution. /// Interface for update routers that handle incoming updates and manage handler execution.
@@ -1,6 +1,6 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
namespace Telegrator.StateKeeping.Components namespace Telegrator.Core.StateKeeping
{ {
/// <summary> /// <summary>
/// Defines a resolver for extracting a key from an update for state keeping purposes. /// Defines a resolver for extracting a key from an update for state keeping purposes.
@@ -1,6 +1,6 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
namespace Telegrator.StateKeeping.Components namespace Telegrator.Core.StateKeeping
{ {
/// <summary> /// <summary>
/// Base class for managing state associated with updates and keys. /// Base class for managing state associated with updates and keys.
+1 -1
View File
@@ -1,4 +1,4 @@
using Telegrator.MadiatorCore.Descriptors; using Telegrator.Core.Descriptors;
namespace Telegrator namespace Telegrator
{ {
@@ -1,6 +1,6 @@
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Filters namespace Telegrator.Filters
{ {
+1 -1
View File
@@ -1,5 +1,5 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.Handlers; using Telegrator.Handlers;
namespace Telegrator.Filters namespace Telegrator.Filters
@@ -1,6 +1,6 @@
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
using Telegrator.Handlers; using Telegrator.Handlers;
namespace Telegrator.Filters namespace Telegrator.Filters
+1 -1
View File
@@ -1,6 +1,6 @@
using System.Diagnostics; using System.Diagnostics;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Filters namespace Telegrator.Filters
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Filters namespace Telegrator.Filters
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Filters namespace Telegrator.Filters
{ {
+1 -1
View File
@@ -1,6 +1,6 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Filters namespace Telegrator.Filters
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegram.Bot.Types.ReplyMarkups; using Telegram.Bot.Types.ReplyMarkups;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Filters namespace Telegrator.Filters
{ {
+1 -1
View File
@@ -1,7 +1,7 @@
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Telegram.Bot.Types; using Telegram.Bot.Types;
using Telegram.Bot.Types.Enums; using Telegram.Bot.Types.Enums;
using Telegrator.Filters.Components; using Telegrator.Core.Filters;
namespace Telegrator.Filters namespace Telegrator.Filters
{ {

Some files were not shown because too many files have changed in this diff Show More