From 1ebf4ec22acb7fe3336154e89642fa276118431c Mon Sep 17 00:00:00 2001 From: Rikitav Date: Fri, 6 Mar 2026 23:27:11 +0400 Subject: [PATCH] generator bug fix --- ...plicitHandlerBuilderExtensionsGenerator.cs | 2 +- docs/Telegrator.Hosting.Web.xml | 62 +- docs/Telegrator.Hosting.xml | 382 +- docs/Telegrator.xml | 4674 ++++++++--------- .../Hosting.Web/TelegramBotWebHostBuilder.cs | 1 - .../Hosting/TelegramBotHostBuilder.cs | 2 +- .../Providers/HostHandlersCollection.cs | 1 - src/Telegrator.Hosting/TypesExtensions.cs | 1 - .../ILocalizedMessageHandler.cs | 1 - .../Core/Descriptors/HandlerDescriptorList.cs | 2 - .../Core/Handlers/BranchingUpdateHandler.cs | 1 - .../Core/Handlers/IHandlerContainerFactory.cs | 1 - src/Telegrator/Mediation/UpdateRouter.cs | 4 +- src/Telegrator/TelegratorClient.cs | 1 - .../Collections/CollectionTests.cs | 2 +- tests/Telegrator.Tests/Filters/FilterTests.cs | 2 +- 16 files changed, 2551 insertions(+), 2588 deletions(-) diff --git a/dev/Telegrator.RoslynGenerators/ImplicitHandlerBuilderExtensionsGenerator.cs b/dev/Telegrator.RoslynGenerators/ImplicitHandlerBuilderExtensionsGenerator.cs index 2b701b1..6bf4d0f 100644 --- a/dev/Telegrator.RoslynGenerators/ImplicitHandlerBuilderExtensionsGenerator.cs +++ b/dev/Telegrator.RoslynGenerators/ImplicitHandlerBuilderExtensionsGenerator.cs @@ -17,7 +17,7 @@ namespace Telegrator.RoslynGenerators private static readonly string[] DefaultUsings = [ "Telegrator.Handlers.Building", - "Telegrator.Handlers.Building.Components" + "Telegrator.Core.Handlers.Building" ]; private static readonly ParameterSyntax ExtensionMethodThisParam = SyntaxFactory.Parameter(SyntaxFactory.Identifier("builder")).WithType(SyntaxFactory.IdentifierName("TBuilder").WithLeadingTrivia(SyntaxFactory.SyntaxTrivia(SyntaxKind.WhitespaceTrivia, " ")).WithTrailingTrivia(WhitespaceTrivia)).WithModifiers([SyntaxFactory.Token(SyntaxKind.ThisKeyword)]); diff --git a/docs/Telegrator.Hosting.Web.xml b/docs/Telegrator.Hosting.Web.xml index b8a1e42..e3d47ff 100644 --- a/docs/Telegrator.Hosting.Web.xml +++ b/docs/Telegrator.Hosting.Web.xml @@ -4,33 +4,12 @@ Telegrator.Hosting.Web - + Interface for Telegram bot hosts with Webhook update receiving. Combines wbe application capabilities with reactive Telegram bot functionality. - - - Service for receiving updates for Hosted telegram bots via Webhooks - - - - - Initiallizes new instance of - - - - - - - - - - - - - Represents a web hosted telegram bot @@ -55,7 +34,7 @@ This application's logger - + Initializes a new instance of the class. @@ -135,7 +114,7 @@ - + Initializes a new instance of the class. @@ -203,26 +182,47 @@ Pass true to drop all pending updates - + - Contains extensions for - Provides method to configure + Service for receiving updates for Hosted telegram bots via Webhooks - + + + Initiallizes new instance of + + + + + + + + + + + + + + + + Contains extensions for + Provides method to configure + + + Replaces TelegramBotWebHostBuilder. Configures DI, options, and handlers. - + Replaces the initialization logic from TelegramBotWebHost constructor. Initializes the bot and logs handlers on application startup. - + - Registers service with to receive updates using webhook + Registers service with to receive updates using webhook diff --git a/docs/Telegrator.Hosting.xml b/docs/Telegrator.Hosting.xml index 4a231bf..830efa0 100644 --- a/docs/Telegrator.Hosting.xml +++ b/docs/Telegrator.Hosting.xml @@ -4,60 +4,21 @@ Telegrator.Hosting - - - Interface for pre-building routines that can be executed during host construction. - Allows for custom initialization and configuration steps before the bot host is built. - - - - - Executes the pre-building routine on the specified host builder. - - The host builder to configure. - - - - Interface for Telegram bot hosts. - Combines host application capabilities with reactive Telegram bot functionality. - - - - - Interface for building Telegram bot hosts with dependency injection support. - Combines host application building capabilities with handler collection functionality. - - - - - Gets the set of key/value configuration properties. - - - - - Gets a collection of logging providers for the application to compose. This is useful for adding new logging providers. - - - - - Gets a collection of services for the application to compose. This is useful for adding user provided or framework provided services. - - - + Abstract base class for configuring options from configuration sources. Provides a proxy pattern for binding configuration to strongly-typed options classes. The type of options to configure. - + Configures the options using the default configuration section. The service collection to configure. The configuration source. - + Configures the options using a named configuration section. @@ -65,7 +26,7 @@ The name of the configuration section. The configuration source. - + Configures the options using a named configuration section with custom binder options. @@ -74,52 +35,38 @@ The configuration source. Optional action to configure the binder options. - + Creates the actual options instance from the configuration. The configured options instance. - + - Internal proxy class for configuring Telegram bot client options from configuration. - Extends ConfigureOptionsProxy to provide specific configuration for Telegram bot client options. + Collection class for managing handler descriptors organized by update type for host apps. + Provides functionality for collecting, adding, scanning, and organizing handlers. - + - Gets or sets the bot token. + List of tasks that should be completed right before building the bot - + - Gets or sets the base URL for the bot API. + Interface for pre-building routines that can be executed during host construction. + Allows for custom initialization and configuration steps before the bot host is built. - + - Gets or sets whether to use the test environment. + Executes the pre-building routine on the specified host builder. - - - - Gets or sets the retry threshold in seconds. - - - - - Gets or sets the number of retry attempts. - - - - - Creates a TelegramBotClientOptions instance from the proxy configuration. - - The configured TelegramBotClientOptions instance. + The host builder to configure. - Implementation of that provides bot information. + Implementation of that provides bot information. Contains metadata about the Telegram bot including user details and service provider for wider filterring abilities @@ -128,7 +75,7 @@ - Implementation of that provides bot information. + Implementation of that provides bot information. Contains metadata about the Telegram bot including user details and service provider for wider filterring abilities @@ -148,121 +95,32 @@ Provides access to configuration of this Hosted telegram bot - + - Adapter for Microsoft.Extensions.Logging to work with Telegrator logging system. - This allows seamless integration with ASP.NET Core logging infrastructure. + Interface for Telegram bot hosts. + Combines host application capabilities with reactive Telegram bot functionality. - + - Initializes a new instance of MicrosoftLoggingAdapter. - - The Microsoft.Extensions.Logging logger instance. - - - - - - - Service for receiving updates for Hosted telegram bots - - - - - - - - - - Service for receiving updates for Hosted telegram bots - - - - - - - - - - - - - - - - - - - - - - of this router + Interface for building Telegram bot hosts with dependency injection support. + Combines host application building capabilities with handler collection functionality. - - - - - - - + - Default exception handler of this router - - - - - - - - - Collection class for managing handler descriptors organized by update type for host apps. - Provides functionality for collecting, adding, scanning, and organizing handlers. + Gets the set of key/value configuration properties. - + - List of tasks that should be completed right before building the bot + Gets a collection of logging providers for the application to compose. This is useful for adding new logging providers. - - - - - - - + - Pre host building task + Gets a collection of services for the application to compose. This is useful for adding user provided or framework provided services. - - - - - - - - - - - - - - List of tasks that should be completed right before building the bot - - - - - - - - - - - - - @@ -280,7 +138,7 @@ This application's logger - + Initializes a new instance of the class. @@ -349,7 +207,7 @@ - + Initializes a new instance of the class. @@ -396,20 +254,162 @@ - + + + Adapter for Microsoft.Extensions.Logging to work with Telegrator logging system. + This allows seamless integration with ASP.NET Core logging infrastructure. + + + + + Initializes a new instance of MicrosoftLoggingAdapter. + + The Microsoft.Extensions.Logging logger instance. + + + + + + + Service for receiving updates for Hosted telegram bots + + + + + + + + + + Service for receiving updates for Hosted telegram bots + + + + + + + + + + + + + + + + + + + + + + of this router + + + + + + + + + + + Default exception handler of this router + + + + + + + + + + + + + + + Pre host building task + + + + + + + + + + + + + + + List of tasks that should be completed right before building the bot + + + + + + + + + + + + + + + + + Internal proxy class for configuring Telegram bot client options from configuration. + Extends ConfigureOptionsProxy to provide specific configuration for Telegram bot client options. + + + + + Gets or sets the bot token. + + + + + Gets or sets the base URL for the bot API. + + + + + Gets or sets whether to use the test environment. + + + + + Gets or sets the retry threshold in seconds. + + + + + Gets or sets the number of retry attempts. + + + + + Creates a TelegramBotClientOptions instance from the proxy configuration. + + The configured TelegramBotClientOptions instance. + + Replaces TelegramBotWebHostBuilder. Configures DI, options, and handlers. - + Contains extensions for - Provides method to configure + Provides method to configure - + - Registers a configuration instance that strongly-typed will bind against using . + Registers a configuration instance that strongly-typed will bind against using . @@ -417,21 +417,21 @@ - + Registers default services - + - Registers service with to receive updates using long polling + Registers service with to receive updates using long polling - + factory method @@ -439,38 +439,38 @@ - + - Provides useful methods to adjust + Provides useful methods to adjust - + Replaces the initialization logic from TelegramBotWebHost constructor. Initializes the bot and logs handlers on application startup. - + Configures bots available commands depending on what handlers was registered - + Adds a Microsoft.Extensions.Logging adapter to Alligator using a logger factory. - + Provides extension methods for reflection and type inspection. - + - Checks if a type implements the interface. + Checks if a type implements the interface. The type to check. diff --git a/docs/Telegrator.xml b/docs/Telegrator.xml index 221f959..f92c58f 100644 --- a/docs/Telegrator.xml +++ b/docs/Telegrator.xml @@ -11,7 +11,7 @@ The filters to apply to messages - + Abstract base attribute for filtering callback-based updates. Supports various message types including regular messages, edited messages, channel posts, and business messages. @@ -198,7 +198,7 @@ The environment filters to apply - + Abstract base attribute for filtering updates based on environment conditions. Can process all types of updates and provides environment-specific filtering logic. @@ -408,7 +408,7 @@ The filters to apply to messages - + Abstract base attribute for filtering message-based updates. Supports various message types including regular messages, edited messages, channel posts, and business messages. @@ -776,14 +776,14 @@ The enum type to be used for state management. - + Initializes a new instance of the EnumStateAttribute with a special state and custom key resolver. The special state to be managed. The resolver for extracting keys from updates. - + Initializes a new instance of the EnumStateAttribute with a specific enum state and custom key resolver. @@ -808,14 +808,14 @@ Provides constructors for flexible state and key resolver configuration. - + Initializes the attribute with a special state and a custom key resolver. The special state to associate The key resolver for state keeping - + Initializes the attribute with a specific numeric state and a custom key resolver. @@ -860,14 +860,14 @@ Provides various constructors for flexible state and key resolver configuration. - + Initializes the attribute with a special state and a custom key resolver. The special state to associate The key resolver for state keeping - + Initializes the attribute with a specific state and a custom key resolver. @@ -928,7 +928,7 @@ Implement this interface to add cross-cutting concerns like logging, cleanup, or metrics collection. - + Executes after the handler's main execution logic. @@ -942,7 +942,7 @@ Implement this interface to add cross-cutting concerns like validation, logging, or authorization. - + Executes before the handler's main execution logic. @@ -950,117 +950,6 @@ A indicating whether execution should continue or be stopped. - - - Sets the state in which the can be executed - - - - - - - - Creates a new instance - - - - - - - Realizes a for validation of the current in the polling routing - - - - - - - Defines the to validation for entry into execution of the - - - - - Gets the 's that processing - - - - - Gets the that processing - - - - - Gets or sets the filter modifiers that affect how this filter is combined with others. - - - - - Creates a new instance of - - - - - - Determines the logic of filter modifiers. Exceptionally internal implementation - - - - - - Defines the 's and validator () of the that will process - - - - - - - - Gets an array of that this attribute can be attached to - - - - - Gets an that handlers processes - - - - - Gets or sets importance of this in same pool - - - - - Gets or sets priority of this in same type handlers pool - - - - - Gets or sets a value indicating whether to form a fallback report. - - - - - Creates a new instance of - - The types of handlers that this attribute can be applied to. - The type of update that this handler processes. - The importance level of this handler (default: 0). - Thrown when is null. - Thrown when one of the handler types is not a valid handler type. - Thrown when is . - - - - Gets an of this from and - - A descriptor indexer for this handler attribute. - - - - Validator () of the that will process - - The filter execution context containing the update to validate. - True if the update passes validation; otherwise, false. - Reactive way to implement a new of type @@ -1084,7 +973,7 @@ - + @@ -1137,21 +1026,21 @@ Gets the special state mode for this attribute instance. - + Initializes the attribute with a specific state and a custom key resolver. The state value to associate The key resolver for state keeping - + Initializes the attribute with a special state and a custom key resolver. The special state mode The key resolver for state keeping - + Determines whether the current update context passes the state filter. @@ -1180,19 +1069,19 @@ Empty constructor for internal using - + Initializes the attribute with one or more filters for the update target. The filters to compose - + Initializes the attribute with a precompiled filter for the update target. The compiled filter - + Processes filter modifiers and combines this filter with the previous one if needed. @@ -1241,43 +1130,2047 @@ The type of update that this handler can process. The importance level for this handler - + + + Sets the state in which the can be executed + + + + + + + + Creates a new instance + + + + + + + Realizes a for validation of the current in the polling routing + + + + + + + Defines the to validation for entry into execution of the + + + + + Gets the 's that processing + + + + + Gets the that processing + + + + + Gets or sets the filter modifiers that affect how this filter is combined with others. + + + + + Creates a new instance of + + + + + + Determines the logic of filter modifiers. Exceptionally internal implementation + + + + + + Defines the 's and validator () of the that will process + + + + + + + + Gets an array of that this attribute can be attached to + + + + + Gets an that handlers processes + + + + + Gets or sets importance of this in same pool + + + + + Gets or sets priority of this in same type handlers pool + + + + + Gets or sets a value indicating whether to form a fallback report. + + + + + Creates a new instance of + + The types of handlers that this attribute can be applied to. + The type of update that this handler processes. + The importance level of this handler (default: 0). + Thrown when is null. + Thrown when one of the handler types is not a valid handler type. + Thrown when is . + + + + Gets an of this from and + + A descriptor indexer for this handler attribute. + + + + Validator () of the that will process + + The filter execution context containing the update to validate. + True if the update passes validation; otherwise, false. + + + + Descriptor for creating handlers from methods + + + + + + Initializes new instance of + + + + + + Contains information about a described handler, including its context, client, and execution logic. + + + + + descriptor from that handler was described from + + + + + The update router associated with this handler. + + + + + The awaiting provider to fetch new updates inside handler + + + + + The Telegram bot client used for this handler. + + + + + The handler instance being described. + + + + + Extra data associated with the handler execution. + + + + + List of completed filters for this handler. + + + + + The update being handled. + + + + + Lifetime token for the handler instance. + + + + + Display string for the handler (for debugging or logging). + + + + + The final execution result. + + + + + Initializes a new instance of the class. + + descriptor from that handler was described from + + The update router. + The Telegram bot client. + The handler instance. + The filter execution context. + Optional display string. + + + + + + + Manages the execution of pre and post-execution aspects for a handler. + This class coordinates between self-processing (handler implements interfaces) + and typed processing (external processor classes). + + + + + Gets the type of the external pre-processor, if specified via . + + + + + Gets the type of the external post-processor, if specified via . + + + + + Initializes a new instance of the class. + + The type of external pre-processor, if any. + The type of external post-processor, if any. + + + + Executes the pre-execution aspect for the handler. + + The handler instance. + The handler container with update context. + + A indicating whether execution should continue. + Thrown when handler claims to implement but doesn't. + + + + Executes the post-execution aspect for the handler. + + The handler instance. + The handler container with update context. + + A indicating the final execution result. + Thrown when handler claims to implement but doesn't. + + + + Represents a set of filters for a handler descriptor, including update and state keeper validators. + + + + + Validator for the update object. + + + + + Validator for the state keeper. + + + + + Array of update filters. + + + + + Initializes a new instance of the class. + + Validator for the update object. + Validator for the state keeper. + Array of update filters. + + + + Validates the filter context using all filters in the set. + + The filter execution context. + + + True if all filters pass; otherwise, false. + + + + Represents an indexer for handler descriptors, containing importance and priority information. + + + + + Represents an indexer for handler descriptors, containing importance and priority information. + + + + + Index of this descriptor when it was added to router + + + + + Of this handlert type + + + + + The priority of the handler. + + + + + Initializes a new instance of the struct from a handler attribute. + + + The handler attribute. + + + + Returns a new with updated priority. + + The new priority value. + A new instance. + + + + Returns a new with updated importance. + + The new importance value. + A new instance. + + + + Returns a new with updated RouterIndex. + + + A new instance. + + + + Compares this instance to another . + + The other indexer to compare to. + An integer indicating the relative order. + + + + Returns a string representation of the indexer. + + A string in the format (C:importance, P:priority). + + + + Specifies the type of handler descriptor. + + + + + General handler descriptor. + + + + + Keyed handler descriptor (uses a service key). + + + + + Implicit handler descriptor. + + + + + Singleton handler descriptor (single instance). + + + + + Describes a handler, its type, filters, and instantiation logic. + + + + + The type of the descriptor. + + + + + The type of the handler. + + + + + The update type handled by this handler. + + + + + The indexer for handler concurrency and priority. + + + + + Gets or sets a value indicating whether to form a fallback report. + + + + + The set of filters associated with this handler. + + + + + Gets or sets the aspects configuration for this handler. + Contains pre and post-execution processors if the handler uses the aspect system. + + + + + The service key for keyed handlers. + + + + + Factory for creating handler instances. + + + + + Singleton instance of the handler, if applicable. + + + + + Display string for the handler (for debugging or logging). + + + + + Gets or sets a function for 'lazy' handlers initialization + + + + + Initializes a new instance of the class with the specified descriptor type and handler type. + Automatically inspects the handler type to extract attributes, filters, and configuration. + + The type of the descriptor + The type of the handler to describe + + Thrown when the handler type is not compatible with the expected handler type + + + + Initializes a new instance of the class as a keyed handler with the specified service key. + + The type of the handler to describe + The service key for dependency injection + Thrown when is null + + + + Initializes a new instance of the class with all basic properties. + + The type of the descriptor + The type of the handler + The type of update this handler processes + The indexer for handler concurrency and priority + The set of filters associated with this handler + + + + Initializes a new instance of the class with singleton instance support. + + The type of the descriptor + The type of the handler + The type of update this handler processes + The indexer for handler concurrency and priority + The set of filters associated with this handler + The service key for dependency injection + The singleton instance of the handler + Thrown when or is null + + + + Initializes a new instance of the class with instance factory support. + + The type of the descriptor + The type of the handler + The type of update this handler processes + The indexer for handler concurrency and priority + The set of filters associated with this handler + Factory for creating handler instances + Thrown when is null + + + + Initializes a new instance of the class with service key and instance factory support. + + The type of the descriptor + The type of the handler + The type of update this handler processes + The indexer for handler concurrency and priority + The set of filters associated with this handler + The service key for dependency injection + Factory for creating handler instances + Thrown when or is null + + + + Initializes a new instance of the class with polling handler attribute and filters. + + The type of the descriptor + The type of the handler + The polling handler attribute containing configuration + Optional array of filters to apply + Optional state keeping filter + + + + Initializes a new instance of the class with polling handler attribute, filters, and singleton instance. + + The type of the descriptor + The type of the handler + The polling handler attribute containing configuration + Optional array of filters to apply + Optional state keeping filter + The service key for dependency injection + The singleton instance of the handler + Thrown when or is null + + + + Initializes a new instance of the class with polling handler attribute, filters, and instance factory. + + The type of the descriptor + The type of the handler + The polling handler attribute containing configuration + Optional array of filters to apply + Optional state keeping filter + Factory for creating handler instances + Thrown when is null + + + + Initializes a new instance of the class with polling handler attribute, filters, service key, and instance factory. + + The type of the descriptor + The type of the handler + The polling handler attribute containing configuration + Optional array of filters to apply + Optional state keeping filter + The service key for dependency injection + Factory for creating handler instances + Thrown when or is null + + + + Initializes a new instance of the class with validation filter support. + + The type of the descriptor + The type of the handler + The type of update this handler processes + The indexer for handler concurrency and priority + Optional validation filter + Optional array of filters to apply + Optional state keeping filter + + + + Initializes a new instance of the class with validation filter and singleton instance support. + + The type of the descriptor + The type of the handler + The type of update this handler processes + The indexer for handler concurrency and priority + Optional validation filter + Optional array of filters to apply + Optional state keeping filter + The service key for dependency injection + The singleton instance of the handler + Thrown when or is null + + + + Initializes a new instance of the class with validation filter and instance factory support. + + The type of the descriptor + The type of the handler + The type of update this handler processes + The indexer for handler concurrency and priority + Optional validation filter + Optional array of filters to apply + Optional state keeping filter + Factory for creating handler instances + Thrown when is null + + + + Initializes a new instance of the class with validation filter, service key, and instance factory support. + + The type of the descriptor + The type of the handler + The type of update this handler processes + The indexer for handler concurrency and priority + Optional validation filter + Optional array of filters to apply + Optional state keeping filter + The service key for dependency injection + Factory for creating handler instances + Thrown when or is null + + + + Sets singleton instance of this descriptor + Throws exception if instance already set + + + + + + + Tries to set singleton instance of this descriptor + + + + + + + + + + The collection containing the 's. Used to route 's in + + + + + Gets a value indicating whether the collection is read-only. + + + + + Gets the of handlers in this collection. + + + + + Gets count of registered handlers in list + + + + + Gets or sets the at the specified index. + + + + + + + Initializes a new instance of the class without a specific . + + + + + Initializes a new instance of the class. + + The update type for the handlers. + The collecting options. + + + + Adds a new to the collection. + + The handler descriptor to add. + Thrown if the collection is frozen. + Thrown if the update type does not match. + + + + Checks if the collection contains a with the specified . + + The descriptor indexer. + True if the descriptor exists; otherwise, false. + + + + Removes the with the specified from the collection. + + The descriptor indexer. + True if the descriptor was removed; otherwise, false. + + + + Removes the from the collection. + + + + + + + Removes all descriptos from the + + + + + Freezes the and prohibits adding new elements to it. + + + + + + + + + + + Provides methods for inspecting handler types and retrieving their attributes and filters. + + + + + Gets handler's display name + + + + + + + Gets the handler attribute from the specified member info. + + The member info representing the handler type. + The handler attribute. + + + + Gets the state keeper attribute from the specified member info, if present. + + The member info representing the handler type. + The state keeper attribute, or null if not present. + + + + Gets all filter attributes for the specified handler type and update type. + + The member info representing the handler type. + The valid update type. + An enumerable of filter attributes. + + + + Gets the aspects configuration for the specified handler type. + Inspects the handler for both self-processing (implements interfaces) and typed processing (uses attributes). + + The type of the handler to inspect. + A containing the aspects configuration. + + + + Represents a compiled filter that applies a set of filters to an anonymous target type. + + + + + Gets the name of this compiled filter. + + + + + Initializes a new instance of the class. + + The name of the compiled filter. + The filter action delegate. + The function to get the filtering target from an update. + + + + Compiles a set of filters into an for a specific target type. + + The type of the filtering target. + The list of filters to compile. + The function to get the filtering target from an update. + The compiled filter. + + + + Compiles a set of filters into an for a specific target type with a custom name. + + The type of the filtering target. + The custom name for the compiled filter. + The list of filters to compile. + The function to get the filtering target from an update. + The compiled filter. + + + + Determines whether all filters can pass for the given context and filtering target. + + The type of the filtering target. + The list of filters. + The filter execution context. + The filtering target. + True if all filters pass; otherwise, false. + + + + + + + Represents a filter that applies a filter action to an anonymous target type extracted from an update. + + + + + Gets the name of this filter. + + + + + Initializes a new instance of the class. + + The name of the filter. + The filter action delegate. + The function to get the filtering target from an update. + + + + Compiles a filter for a specific target type. + + The type of the filtering target. + The filter to apply. + The function to get the filtering target from an update. + The compiled filter. + + + + Compiles a filter for a specific target type with a custom name. + + The type of the filtering target. + The custom name for the compiled filter. + The filter to apply. + The function to get the filtering target from an update. + The compiled filter. + + + + Determines whether the filter can pass for the given context and filtering target. + + The type of the filtering target. + The filter execution context. + The filter to apply. + The filtering target. + True if the filter passes; otherwise, false. + + + + Determines whether the filter can pass for the given context by extracting the filtering target and applying the filter action. + + The filter execution context. + True if the filter passes; otherwise, false. + + + + Represents a filter that composes multiple filters and passes only if all of them pass. + + The type of the input for the filter. + + + + Gets the name of this compiled filter. + + + + + Initializes a new instance of the class. + + The filters to compose. + + + + Initializes a new instance of the class with a custom name. + + The custom name for the compiled filter. + The filters to compose. + + + + Determines whether all composed filters pass for the given context. + + The filter execution context. + True if all filters pass; otherwise, false. + + + + The list containing filters worked out during Polling to further obtain additional filtering information + + + + + Adds the completed filter to the list. + + The type of update. + The filter to add. + + + + Adds many completed filters to the list. + + The type of update. + The filters to add. + + + + Looks for filters of a given type in the list. + + The filter type to search for. + The enumerable containing filters of the given type. + Thrown if the type is not a filter type. + + + + Looks for a filter of a given type at the specified index in the list. + + The filter type to search for. + The index of the filter. + The filter of the given type at the specified index. + Thrown if the type is not a filter type. + Thrown if no filter is found at the index. + + + + Returns a filter of a given type at the specified index, or null if it does not exist. + + The filter type to search for. + The index of the filter. + The filter at the specified index, or null if it does not exist. + Thrown if the type is not a filter type. + + + + + + + + + + Represents the context for filter execution, including update, input, and additional data. + + The type of the input for the filter. + + + + Gets the for the current context. + + + + + Gets the additional data dictionary for the context. + + + + + Gets the list of completed filters for the context. + + + + + Gets the being processed. + + + + + Gets the of the update. + + + + + Gets the input object for the filter. + + + + + Initializes a new instance of the class with all parameters. + + The bot info. + The update. + The input object. + The additional data dictionary. + The list of completed filters. + + + + Initializes a new instance of the class with default data and filters. + + The bot info. + The update. + The input object. + + + + Creates a child context for a different input type, sharing the same data and completed filters. + + The type of the new input. + The new input object. + A new instance. + + + + Interface for filters that have a name for identification and debugging purposes. + + + + + Gets the name of the filter. + + + + + Interface for filters that can be collected into a completed filters list. + Provides information about whether a filter should be tracked during execution. + + + + + Gets if filter can be collected to + + + + + Represents a filter for a specific update type. + + The type of the update to filter. + + + + Determines whether the filter can pass for the given context. + + The filter execution context. + True if the filter passes; otherwise, false. + + + + Represents a filter that joins multiple filters together. + + The type of the input for the filter. + + + + Gets the array of joined filters. + + + + + Abstract handler for Telegram updates of type . + + + + + Handler container for the current update. + + + + + Telegram Bot client associated with the current container. + + + + + Incoming update of type . + + + + + The Telegram update being handled. + + + + + Additional data associated with the handler execution. + + + + + List of successfully passed filters. + + + + + Provider for awaiting asynchronous operations. + + + + + Initializes a new instance and checks that the update type matches . + + The type of update to handle. + + + + Creates a handler container for the specified awaiting provider and handler info. + + The handler descriptor info. + The created handler container. + + + + Executes the handler logic using the specified container. + + The handler container. + Cancellation token. + A task representing the asynchronous operation. + + + + Abstract method to execute the update handling logic. + + The handler container. + Cancellation token. + A task representing the asynchronous operation. + + + + Abstract base class for handlers that support branching execution based on different methods. + Allows multiple handler methods to be defined in a single class, each with its own filters. + + The type of update being handled. + + + + The method info for the current branch being executed. + + + + + Gets the binding flags used to discover branch methods. + + + + + Gets the allowed return types for branch methods. + + + + + Gets the cancellation token for the current execution. + + + + + Initializes a new instance of the class. + + The type of update this handler processes. + + + + Describes all handler branches in this class. + + A collection of handler descriptors for each branch method. + Thrown when no branch methods are found. + + + + Describes a specific branch method. + + The branch method to describe. + The handler attribute for the class. + The filters applied to the class. + A handler descriptor for the branch method. + Thrown when the branch method has parameters or invalid return type. + + + + Creates a handler container for this branching handler. + + The handler information. + A handler container for this branching handler. + Thrown when the awaiting provider is not of the expected type. + + + + Executes the current branch method. + + The handler container. + The cancellation token. + Thrown when no branch method is set. + + + + Wraps the execution of a branch method, handling both void and Task return types. + + The handler container. + The method to execute. + + + + Base class for building handler descriptors and managing handler filters. + + + + + Base class for building handler descriptors and managing handler filters. + + + + + to ehich new builded handlers is adding + + + + + of building handler + + + + + Type of handler to build + + + + + Filters applied to handler + + + + + of building handler + + + + + Update validation filter of building handler + + + + + State keeper of building handler + + + + + Builds an implicit for the specified handler instance. + + The instance. + The created . + + + + Gets a unique service key for an implicit handler type. + + The handler type. + A unique service key string. + + + + Sets the update validating action for the handler. + + The to use. + The builder instance. + + + + Sets the concurrency level for the handler. + + The concurrency value. + The builder instance. + + + + Sets the priority for the handler. + + The priority value. + The builder instance. + + + + Sets both concurrency and priority for the handler. + + The concurrency value. + The priority value. + The builder instance. + + + + Adds a filter to the handler. + + The to add. + The builder instance. + + + + Adds multiple filters to the handler. + + The filters to add. + The builder instance. + + + + Sets a state keeper for the handler using a specific state and key resolver. + + The type of the key. + The type of the state. + The type of the state keeper. + The state value. + The key resolver. + The builder instance. + + + + Sets a state keeper for the handler using a special state and key resolver. + + The type of the key. + The type of the state. + The type of the state keeper. + The special state value. + The key resolver. + The builder instance. + + + + Adds a targeted filter for a specific filter target type. + + The type of the filter target. + Function to get the filter target from an update. + The filter to add. + The builder instance. + + + + Adds multiple targeted filters for a specific filter target type. + + The type of the filter target. + Function to get the filter target from an update. + The filters to add. + The builder instance. + + + + Defines a builder for awaiting handler logic for a specific update type. + + The type of update to await. + + + + Awaits an update using the specified key resolver and cancellation token. + + The to resolve the key. + The cancellation token. + A representing the awaited update. + + + + Defines builder actions for configuring handler builders. + + + + + Sets the update validating action for the handler. + + The to use. + The builder instance. + + + + Sets the concurrency level for the handler. + + The concurrency value. + The builder instance. + + + + Sets the priority for the handler. + + The priority value. + The builder instance. + + + + Sets both concurrency and priority for the handler. + + The concurrency value. + The priority value. + The builder instance. + + + + Adds a filter to the handler. + + The to add. + The builder instance. + + + + Adds multiple filters to the handler. + + The filters to add. + The builder instance. + + + + Sets a state keeper for the handler using a specific state and key resolver. + + The type of the key. + The type of the state. + The type of the state keeper. + The state value. + The key resolver. + The builder instance. + + + + Sets a state keeper for the handler using a special state and key resolver. + + The type of the key. + The type of the state. + The type of the state keeper. + The special state value. + The key resolver. + The builder instance. + + + + Adds a targeted filter for a specific filter target type. + + The type of the filter target. + Function to get the filter target from an update. + The filter to add. + The builder instance. + + + + Adds multiple targeted filters for a specific filter target type. + + The type of the filter target. + Function to get the filter target from an update. + The filters to add. + The builder instance. + + + + Defines a builder for regular handler logic for a specific update type. + + The type of update to handle. + + + + Builds the handler logic using the specified execution delegate. + + The delegate to execute the handler logic. + + + + Filter for state keeping logic, allowing filtering based on state and special state conditions. + + The type of the key for state resolution. + The type of the state. + The type of the state keeper. + + + + Gets or sets the state keeper instance. + + + + + Gets the state value for this filter. + + + + + Gets the special state value for this filter. + + + + + Initializes a new instance of the class with a specific state. + + The state value. + The key resolver. + + + + Initializes a new instance of the class with a special state. + + The special state value. + The key resolver. + + + + Determines whether the filter can pass for the given context based on state logic. + + The filter execution context. + True if the filter passes; otherwise, false. + + + + Delegate for validating an update in a filter context. + + The filter execution context. + True if the update is valid; otherwise, false. + + + + Filter that uses a delegate to validate updates. + + + + + Gets a value indicating whether this filter is collectable. Always false for this filter. + + + + + Initializes a new instance of the class. + + The validation delegate to use. + + + + Determines whether the filter can pass for the given context using the validation delegate. + + The filter execution context. + True if the filter passes; otherwise, false. + + + + Represents an empty handler container that throws for all members. + + + + + + + + + + + + + + + + + + + + Represents a token that tracks the lifetime of a handler instance. + + + + + Event triggered when the handler's lifetime has ended. + + + + + Gets a value indicating whether the handler's lifetime has ended. + + + + + Marks the handler's lifetime as ended and triggers the event. + + + + + Abstract handler for Telegram updates of type . + + + + + Handler container for the current update. + + + + + Abstract method to execute the update handling logic. + + The handler container. + Cancellation token. + A task representing the asynchronous operation. + + + + Interface for handler containers that provide context and resources for update handlers. + Contains all necessary information and services that handlers need during execution. + + + + + Gets the being handled. + + + + + Gets the used for this handler. + + + + + Gets the extra data associated with the handler execution. + + + + + Gets the for this handler. + + + + + Gets the for awaiting operations. + + + + + Factory interface for creating handler containers. + Provides a way to create handler containers with specific providers and handler information. + + + + + Creates a new for the specified awaiting provider and handler info. + + The for the handler. + A new instance. + + + + Abstraction for update handlers, providing execution and lifetime management for Telegram updates. + + + + + Gets the that this handler processes. + + + + + Gets the associated with this handler instance. + + + + + Executes the handler logic and marks the lifetime as ended after execution. + + + The cancellation token. + A representing the asynchronous operation. + + + + Handles failed filters during handler describing. + Use to control how router should treat this fail. + to silently continue decribing. + to stop\break desribing sequence. + + + + + + + + + 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. + + + + + Gets the that this handler processes. + + + + + Gets the associated with this handler instance. + + + + + + + + + + + + + + Executes the handler logic and marks the lifetime as ended after execution. + + + The cancellation token. + A representing the asynchronous operation. + + + + Executes the handler logic for the given container and cancellation token. + + The for the update. + The cancellation token. + A representing the asynchronous operation. + + + + Dispose resources of this handler. Override if needed + + + Return if dispose was successfull and garbage collecting for this object can be supressed + + + + Handles failed filters during handler describing. + Use to control how router should treat this fail. + to silently continue decribing. + to stop\break desribing sequence. + + + + + + + + + + + + Provider for managing awaiting handlers that can wait for specific update types. + + + + + Registers the usage of a handler and returns a disposable object to manage its lifetime. + + The to use. + An that manages the handler's usage lifetime. + + + + Interface for providers that collect and manage handler collections. + Provides access to a collection of handlers for various processing operations. + + + + + Gets the collection of handlers managed by this provider. + + + + + Interface for classes that can provide custom handler descriptors. + Allows classes to define their own handler description logic beyond the standard reflection-based approach. + + + + + Describes the handlers provided by this class. + + A collection of handler descriptors. + + + + Collection class for managing handler descriptors organized by update type. + Provides functionality for collecting, adding, and organizing handlers. + + + + + Gets the collection of 's allowed by registered handlers + + + + + Gets the collection of keys for the handler lists. + + + + + Gets the collection of values. + + + + + Gets the for the specified . + + The update type key. + The handler descriptor list for the given update type. + + + + Adds a to the collection and returns the updated collection. + + The handler descriptor to add. + The updated . + + + + Combines and . + Provides functionality of collecting, organizing and resolving handlers instances. + + + + + Provides methods to retrieve and describe handler information for updates. + + + + + Gets the collection of 's allowed by registered handlers + + + + + + + + + + + + + Instantiates a handler for the given descriptor, using the appropriate creation strategy based on descriptor type. + Supports singleton, implicit, keyed, and general descriptor types with different instantiation patterns. + + The handler descriptor. + + An instance of for the descriptor + + + + Determines whether the provider contains any handlers. + + True if the provider is empty; otherwise, false. + + + + Interface for polling providers that manage both regular and awaiting handlers. + Provides access to handlers for different types of update processing during polling operations. + + + + + Gets the that manages handlers for polling. + + + + + Gets the that manages awaiting handlers for polling. + + + + + Interface for handling exceptions that occur during update routing operations. + Provides a centralized way to handle and log errors that occur during bot operation. + + + + + Handles exceptions that occur during update routing. + + The instance. + The exception that occurred. + The indicating the source of the error. + The cancellation token. + + Interface for providing bot information and metadata. Contains information about the bot user and provides initialization capabilities. - + - Gets the representing the bot. + Gets the representing the bot. - + - Interface for configuring Telegram bot behavior and execution settings. - Controls various aspects of bot operation including concurrency, routing, collecting, and execution policies. + Represents a delegate for when a handler is enqueued. + + The for the enqueued handler. + + + + Represents a delegate for when a handler is executing. + + The for the executing handler. + + + + Provides a pool for managing the execution and queuing of update handlers. - + - Gets or sets the maximum number of parallel working handlers. Null means no limit. + Occurs when a handler is enqueued. - + - Gets or sets a value indicating whether awaiting handlers should be routed separately from regular handlers. + Occurs when a handler is entering execution. - + - Gets or sets a value indicating whether to exclude intersecting command aliases. + Enqueues a collection of handlers for execution. + + The handlers to enqueue. + + + + + Starts receiving s invoking for each . + + This method will block if awaited. + + + The used for processing s + The with which you can stop receiving + A that will be completed when cancellation will be requested through + + + + Interface for update routers that handle incoming updates and manage handler execution. + Combines update handling capabilities with polling provider functionality and exception handling. - + - Gets or sets the global cancellation token for all bot operations. + Gets the for the router. + + + Gets the that manages handler execution. + + + + + Gets or sets the for handling exceptions. + + + + + Default hand;er container factory + + + + + Defines a resolver for extracting a key from an update for state keeping purposes. + + The type of the key. + + + + Resolves a key from the specified . + + The update to resolve the key from. + The resolved key. + + + + Base class for managing state associated with updates and keys. + + The type of the key used for state resolution. + The type of the state. + + + + Gets or sets the key resolver used to resolve keys from updates. + + + + + Gets the default state value. + + + + + Sets the state for the specified update. + + The update to use as a key source. + The new state value. + + + + Gets the state for the specified update. + + The update to use as a key source. + The state value. + + + + Tries to get the state for the specified update. + + The update to use as a key source. + When this method returns, contains the state value if found; otherwise, the default value. + True if the state was found; otherwise, false. + + + + Determines whether a state exists for the specified update. + + The update to use as a key source. + True if the state exists; otherwise, false. + + + + Creates a state for the specified update using the default state value. + + The update to use as a key source. + + + + Deletes the state for the specified update. + + The update to use as a key source. + + + + Moves the state forward for the specified update. + + The update to use as a key source. + + + + Moves the state backward for the specified update. + + The update to use as a key source. + + + + Moves the state forward for the specified current state and key. + + The current state value. + The key. + The new state value. + + + + Moves the state backward for the specified current state and key. + + The current state value. + The key. + The new state value. + Enumeration of dice types supported by Telegram. @@ -1377,7 +3270,7 @@ The handler info associated with the faulted handler. - + Initializes a new instance of the class. @@ -1395,7 +3288,7 @@ - + @@ -1409,7 +3302,7 @@ - + @@ -1449,7 +3342,7 @@ Gets the command that was received and extracted by the . - + Checks if the received command matches any of the specified aliases. This filter requires a to be applied first @@ -1477,14 +3370,14 @@ Gets the chosen argument at the specified index. - + Determines whether the filter can pass by extracting the command argument and validating it. The filter execution context containing the message. True if the argument exists and passes validation; otherwise, false. - + Determines whether the filter can pass for the given context. @@ -1503,7 +3396,7 @@ - + @@ -1532,7 +3425,7 @@ The string comparison type to use for the check. - + Checks if the command argument starts with the specified content using the configured comparison. @@ -1565,7 +3458,7 @@ The string comparison type to use for the check. - + Checks if the command argument ends with the specified content using the configured comparison. @@ -1598,7 +3491,7 @@ The string comparison type to use for the check. - + Checks if the command argument contains the specified content using the configured comparison. @@ -1631,7 +3524,7 @@ The string comparison type to use for the check. - + Checks if the command argument equals the specified content using the configured comparison. @@ -1666,307 +3559,13 @@ The timeout for the regex match operation. The index of the argument to check (0-based). - + Checks if the command argument matches the regular expression pattern. The filter execution context. True if the argument matches the regex pattern; otherwise, false. - - - Represents a compiled filter that applies a set of filters to an anonymous target type. - - - - - Gets the name of this compiled filter. - - - - - Initializes a new instance of the class. - - The name of the compiled filter. - The filter action delegate. - The function to get the filtering target from an update. - - - - Compiles a set of filters into an for a specific target type. - - The type of the filtering target. - The list of filters to compile. - The function to get the filtering target from an update. - The compiled filter. - - - - Compiles a set of filters into an for a specific target type with a custom name. - - The type of the filtering target. - The custom name for the compiled filter. - The list of filters to compile. - The function to get the filtering target from an update. - The compiled filter. - - - - Determines whether all filters can pass for the given context and filtering target. - - The type of the filtering target. - The list of filters. - The filter execution context. - The filtering target. - True if all filters pass; otherwise, false. - - - - - - - Represents a filter that applies a filter action to an anonymous target type extracted from an update. - - - - - Gets the name of this filter. - - - - - Initializes a new instance of the class. - - The name of the filter. - The filter action delegate. - The function to get the filtering target from an update. - - - - Compiles a filter for a specific target type. - - The type of the filtering target. - The filter to apply. - The function to get the filtering target from an update. - The compiled filter. - - - - Compiles a filter for a specific target type with a custom name. - - The type of the filtering target. - The custom name for the compiled filter. - The filter to apply. - The function to get the filtering target from an update. - The compiled filter. - - - - Determines whether the filter can pass for the given context and filtering target. - - The type of the filtering target. - The filter execution context. - The filter to apply. - The filtering target. - True if the filter passes; otherwise, false. - - - - Determines whether the filter can pass for the given context by extracting the filtering target and applying the filter action. - - The filter execution context. - True if the filter passes; otherwise, false. - - - - Represents a filter that composes multiple filters and passes only if all of them pass. - - The type of the input for the filter. - - - - Gets the name of this compiled filter. - - - - - Initializes a new instance of the class. - - The filters to compose. - - - - Initializes a new instance of the class with a custom name. - - The custom name for the compiled filter. - The filters to compose. - - - - Determines whether all composed filters pass for the given context. - - The filter execution context. - True if all filters pass; otherwise, false. - - - - The list containing filters worked out during Polling to further obtain additional filtering information - - - - - Adds the completed filter to the list. - - The type of update. - The filter to add. - - - - Adds many completed filters to the list. - - The type of update. - The filters to add. - - - - Looks for filters of a given type in the list. - - The filter type to search for. - The enumerable containing filters of the given type. - Thrown if the type is not a filter type. - - - - Looks for a filter of a given type at the specified index in the list. - - The filter type to search for. - The index of the filter. - The filter of the given type at the specified index. - Thrown if the type is not a filter type. - Thrown if no filter is found at the index. - - - - Returns a filter of a given type at the specified index, or null if it does not exist. - - The filter type to search for. - The index of the filter. - The filter at the specified index, or null if it does not exist. - Thrown if the type is not a filter type. - - - - - - - - - - Represents the context for filter execution, including update, input, and additional data. - - The type of the input for the filter. - - - - Gets the for the current context. - - - - - Gets the additional data dictionary for the context. - - - - - Gets the list of completed filters for the context. - - - - - Gets the being processed. - - - - - Gets the of the update. - - - - - Gets the input object for the filter. - - - - - Initializes a new instance of the class with all parameters. - - The bot info. - The update. - The input object. - The additional data dictionary. - The list of completed filters. - - - - Initializes a new instance of the class with default data and filters. - - The bot info. - The update. - The input object. - - - - Creates a child context for a different input type, sharing the same data and completed filters. - - The type of the new input. - The new input object. - A new instance. - - - - Interface for filters that have a name for identification and debugging purposes. - - - - - Gets the name of the filter. - - - - - Interface for filters that can be collected into a completed filters list. - Provides information about whether a filter should be tracked during execution. - - - - - Gets if filter can be collected to - - - - - Represents a filter for a specific update type. - - The type of the update to filter. - - - - Determines whether the filter can pass for the given context. - - The filter execution context. - True if the filter passes; otherwise, false. - - - - Represents a filter that joins multiple filters together. - - The type of the input for the filter. - - - - Gets the array of joined filters. - - Abstract base class for filters that operate based on the current environment. @@ -1999,7 +3598,7 @@ Filter that only passes in debug environment builds. - + Checks if the current environment is debug mode. @@ -2016,7 +3615,7 @@ Filter that only passes in release environment builds. - + Checks if the current environment is release mode. @@ -2074,7 +3673,7 @@ The environment variable name to check. The string comparison type to use. - + Checks if the environment variable matches the expected criteria. @@ -2087,7 +3686,7 @@ The type of the input for the filter. - + Creates a filter from a function. @@ -2106,28 +3705,28 @@ A instance. - + Creates a filter that inverts the result of this filter. A instance. - + Creates a filter that passes only if both this and the specified filter pass. The filter to combine with. An instance. - + Creates a filter that passes if either this or the specified filter pass. The filter to combine with. An instance. - + Creates a filter that passes if either this or the specified filter pass. @@ -2141,16 +3740,16 @@ Gets a value indicating whether this filter is collectible. - + Determines whether the filter can pass for the given context. The filter execution context. True if the filter passes; otherwise, false. - + - Implicitly creates from function + Implicitly creates from function @@ -2160,7 +3759,7 @@ The type of the input for the filter. - + @@ -2169,13 +3768,13 @@ The type of the input for the filter. - + Initializes a new instance of the class. The filter to invert. - + @@ -2184,13 +3783,13 @@ The type of the input for the filter. - + Initializes a new instance of the class. The filter function. - + @@ -2199,7 +3798,7 @@ The type of the input for the filter. - + Base class for filters that join multiple filters together. @@ -2216,14 +3815,14 @@ The type of the input for the filter. - + Initializes a new instance of the class. The left filter. The right filter. - + @@ -2232,14 +3831,14 @@ The type of the input for the filter. - + Initializes a new instance of the class. The left filter. The right filter. - + @@ -2264,7 +3863,7 @@ The username to check for in the mention. - + Checks if the message contains a mention of the specified user or bot. This filter requires a to be applied first @@ -2284,10 +3883,10 @@ Gets the chat of the message being processed. - + - + Determines whether the filter passes for the given chat context. @@ -2299,7 +3898,7 @@ Filters messages whose chat is a forum. - + @@ -2312,7 +3911,7 @@ Filters messages whose chat ID matches the specified value. - + @@ -2332,7 +3931,7 @@ - + @@ -2353,7 +3952,7 @@ The chat title to match. The string comparison to use. - + @@ -2374,7 +3973,7 @@ The chat username to match. The string comparison to use. - + @@ -2397,7 +3996,7 @@ The chat last name to match. The string comparison to use. - + @@ -2410,13 +4009,13 @@ Target message for filterring - + - + - + Determines whether the filter can pass for the given context. @@ -2434,7 +4033,7 @@ The message type to filter by. - + @@ -2442,7 +4041,7 @@ Filters messages that are automatic forwards. - + @@ -2450,7 +4049,7 @@ Filters messages that are sent from offline. - + @@ -2458,7 +4057,7 @@ Filters service messages (e.g., chat events). - + @@ -2466,7 +4065,7 @@ Filters messages that are topic messages. - + @@ -2487,7 +4086,7 @@ The dice type to filter by. The dice value to filter by. - + @@ -2550,7 +4149,7 @@ The content to filter by. The string comparison to use. - + @@ -2577,7 +4176,7 @@ Gets the depth of reply chain traversal. - + Determines if the message can pass through the filter by first validating the reply chain and then applying specific filter logic. @@ -2611,7 +4210,7 @@ Gets the depth of reply chain traversal. - + Determines if the message can pass through the filter by first validating the reply chain and then applying specific filter logic. @@ -2625,7 +4224,7 @@ ( ! ): REQUIRES before - + Checks if the replied message was sent by the bot. @@ -2643,7 +4242,7 @@ Gets the user who sent the message. - + Determines if the message can pass through the filter by validating that the message has a valid sender. @@ -2680,7 +4279,7 @@ The username to check for. The string comparison type to use. - + Checks if the message sender has the specified username. @@ -2738,7 +4337,7 @@ The first name to check for. The string comparison type to use. - + Checks if the message sender has the specified first and/or last name. @@ -2762,7 +4361,7 @@ The user ID to check for. - + Checks if the message sender has the specified user ID. @@ -2779,7 +4378,7 @@ Filter that checks if the message was sent by a bot. - + Checks if the message was sent by a bot. @@ -2796,7 +4395,7 @@ Filter that checks if the message was sent by a premium user. - + Checks if the message was sent by a premium user. @@ -2819,7 +4418,7 @@ Gets the extracted text content from the current message. - + Determines if the message can pass through the filter by validating the message and extracting its text content for further processing. @@ -2851,7 +4450,7 @@ The string comparison type to use for the check. - + Checks if the message text starts with the specified content using the configured comparison. @@ -2882,7 +4481,7 @@ The string comparison type to use for the check. - + Checks if the message text ends with the specified content using the configured comparison. @@ -2913,7 +4512,7 @@ The string comparison type to use for the check. - + Checks if the message text contains the specified content using the configured comparison. @@ -2944,7 +4543,7 @@ The string comparison type to use for the check. - + Checks if the message text equals the specified content using the configured comparison. @@ -2961,7 +4560,7 @@ Filter that checks if the message text is not null or empty. - + Checks if the message text is not null or empty. @@ -2995,7 +4594,7 @@ The search starting position. - + @@ -3024,7 +4623,7 @@ The regex pattern. The regex options. - + Determines whether the regex matches the text extracted from the input. @@ -3037,14 +4636,14 @@ The type of the key used for state resolution. - + Initializes a new instance of the class. The key resolver to extract the key from the update. The target key to compare with. - + @@ -3061,7 +4660,7 @@ - + Always returns true, allowing any update to pass through this filter. @@ -3110,14 +4709,14 @@ The cancellation token to cancel the wait operation. - + Creates a handler container for this awaiter handler. The handler information containing the update. An empty handler container. - + Executes the awaiter handler by setting the reset event. @@ -3145,7 +4744,7 @@ The update that triggered the awaiter creation. - + Initializes a new instance of the class. @@ -3161,7 +4760,7 @@ The cancellation token to cancel the wait operation. The awaited update of type TUpdate. - + Awaits for an update of the specified type using a custom state key resolver. @@ -3196,336 +4795,6 @@ The cancellation token. A task representing the asynchronous execution. - - - Base class for building handler descriptors and managing handler filters. - - - - - Base class for building handler descriptors and managing handler filters. - - - - - to ehich new builded handlers is adding - - - - - of building handler - - - - - Type of handler to build - - - - - Filters applied to handler - - - - - of building handler - - - - - Update validation filter of building handler - - - - - State keeper of building handler - - - - - Builds an implicit for the specified handler instance. - - The instance. - The created . - - - - Gets a unique service key for an implicit handler type. - - The handler type. - A unique service key string. - - - - Sets the update validating action for the handler. - - The to use. - The builder instance. - - - - Sets the concurrency level for the handler. - - The concurrency value. - The builder instance. - - - - Sets the priority for the handler. - - The priority value. - The builder instance. - - - - Sets both concurrency and priority for the handler. - - The concurrency value. - The priority value. - The builder instance. - - - - Adds a filter to the handler. - - The to add. - The builder instance. - - - - Adds multiple filters to the handler. - - The filters to add. - The builder instance. - - - - Sets a state keeper for the handler using a specific state and key resolver. - - The type of the key. - The type of the state. - The type of the state keeper. - The state value. - The key resolver. - The builder instance. - - - - Sets a state keeper for the handler using a special state and key resolver. - - The type of the key. - The type of the state. - The type of the state keeper. - The special state value. - The key resolver. - The builder instance. - - - - Adds a targeted filter for a specific filter target type. - - The type of the filter target. - Function to get the filter target from an update. - The filter to add. - The builder instance. - - - - Adds multiple targeted filters for a specific filter target type. - - The type of the filter target. - Function to get the filter target from an update. - The filters to add. - The builder instance. - - - - Defines a builder for awaiting handler logic for a specific update type. - - The type of update to await. - - - - Awaits an update using the specified key resolver and cancellation token. - - The to resolve the key. - The cancellation token. - A representing the awaited update. - - - - Defines builder actions for configuring handler builders. - - - - - Sets the update validating action for the handler. - - The to use. - The builder instance. - - - - Sets the concurrency level for the handler. - - The concurrency value. - The builder instance. - - - - Sets the priority for the handler. - - The priority value. - The builder instance. - - - - Sets both concurrency and priority for the handler. - - The concurrency value. - The priority value. - The builder instance. - - - - Adds a filter to the handler. - - The to add. - The builder instance. - - - - Adds multiple filters to the handler. - - The filters to add. - The builder instance. - - - - Sets a state keeper for the handler using a specific state and key resolver. - - The type of the key. - The type of the state. - The type of the state keeper. - The state value. - The key resolver. - The builder instance. - - - - Sets a state keeper for the handler using a special state and key resolver. - - The type of the key. - The type of the state. - The type of the state keeper. - The special state value. - The key resolver. - The builder instance. - - - - Adds a targeted filter for a specific filter target type. - - The type of the filter target. - Function to get the filter target from an update. - The filter to add. - The builder instance. - - - - Adds multiple targeted filters for a specific filter target type. - - The type of the filter target. - Function to get the filter target from an update. - The filters to add. - The builder instance. - - - - Defines a builder for regular handler logic for a specific update type. - - The type of update to handle. - - - - Builds the handler logic using the specified execution delegate. - - The delegate to execute the handler logic. - - - - Filter for state keeping logic, allowing filtering based on state and special state conditions. - - The type of the key for state resolution. - The type of the state. - The type of the state keeper. - - - - Gets or sets the state keeper instance. - - - - - Gets the state value for this filter. - - - - - Gets the special state value for this filter. - - - - - Initializes a new instance of the class with a specific state. - - The state value. - The key resolver. - - - - Initializes a new instance of the class with a special state. - - The special state value. - The key resolver. - - - - Determines whether the filter can pass for the given context based on state logic. - - The filter execution context. - True if the filter passes; otherwise, false. - - - - Delegate for validating an update in a filter context. - - The filter execution context. - True if the update is valid; otherwise, false. - - - - Filter that uses a delegate to validate updates. - - - - - Gets a value indicating whether this filter is collectable. Always false for this filter. - - - - - Initializes a new instance of the class. - - The validation delegate to use. - - - - Determines whether the filter can pass for the given context using the validation delegate. - - The filter execution context. - True if the filter passes; otherwise, false. - Delegate for handler execution actions that take a container and cancellation token. @@ -3542,7 +4811,7 @@ The type of update to handle. - + Initializes a new instance of the class. @@ -3563,31 +4832,31 @@ Provides convenient methods for creating handlers and setting state keepers. - - + + - + - + - + - - + + - - + + - - + + - - + + - + Adds a targeted filter for a specific filter target type. @@ -3598,7 +4867,7 @@ The filter to add. The builder instance. - + Adds multiple targeted filters for a specific filter target type. @@ -3609,7 +4878,7 @@ The filters to add. The builder instance. - + Sets a numeric state keeper with a custom key resolver. @@ -3619,7 +4888,7 @@ The key resolver for the state. The handler builder for method chaining. - + Sets a numeric state keeper with a special state and custom key resolver. @@ -3647,7 +4916,7 @@ The special state value. The handler builder for method chaining. - + Sets an enum state keeper with a custom key resolver. @@ -3658,7 +4927,7 @@ The key resolver for the state. The handler builder for method chaining. - + Sets an enum state keeper with a special state and custom key resolver. @@ -3703,7 +4972,7 @@ - + Always returns true, allowing any callback query update to pass through this filter. @@ -3793,7 +5062,7 @@ Message text splited by space characters - + Checks if the update contains a valid bot command and extracts the command text. @@ -3886,352 +5155,6 @@ The arguments string (everything after the command). - - - Abstract handler for Telegram updates of type . - - - - - Handler container for the current update. - - - - - Telegram Bot client associated with the current container. - - - - - Incoming update of type . - - - - - The Telegram update being handled. - - - - - Additional data associated with the handler execution. - - - - - List of successfully passed filters. - - - - - Provider for awaiting asynchronous operations. - - - - - Initializes a new instance and checks that the update type matches . - - The type of update to handle. - - - - Creates a handler container for the specified awaiting provider and handler info. - - The handler descriptor info. - The created handler container. - - - - Executes the handler logic using the specified container. - - The handler container. - Cancellation token. - A task representing the asynchronous operation. - - - - Abstract method to execute the update handling logic. - - The handler container. - Cancellation token. - A task representing the asynchronous operation. - - - - Abstract base class for handlers that support branching execution based on different methods. - Allows multiple handler methods to be defined in a single class, each with its own filters. - - The type of update being handled. - - - - The method info for the current branch being executed. - - - - - Gets the binding flags used to discover branch methods. - - - - - Gets the allowed return types for branch methods. - - - - - Gets the cancellation token for the current execution. - - - - - Initializes a new instance of the class. - - The type of update this handler processes. - - - - Describes all handler branches in this class. - - A collection of handler descriptors for each branch method. - Thrown when no branch methods are found. - - - - Describes a specific branch method. - - The branch method to describe. - The handler attribute for the class. - The filters applied to the class. - A handler descriptor for the branch method. - Thrown when the branch method has parameters or invalid return type. - - - - Creates a handler container for this branching handler. - - The handler information. - A handler container for this branching handler. - Thrown when the awaiting provider is not of the expected type. - - - - Executes the current branch method. - - The handler container. - The cancellation token. - Thrown when no branch method is set. - - - - Wraps the execution of a branch method, handling both void and Task return types. - - The handler container. - The method to execute. - - - - Represents an empty handler container that throws for all members. - - - - - - - - - - - - - - - - - - - - Represents a token that tracks the lifetime of a handler instance. - - - - - Event triggered when the handler's lifetime has ended. - - - - - Gets a value indicating whether the handler's lifetime has ended. - - - - - Marks the handler's lifetime as ended and triggers the event. - - - - - Abstract handler for Telegram updates of type . - - - - - Handler container for the current update. - - - - - Abstract method to execute the update handling logic. - - The handler container. - Cancellation token. - A task representing the asynchronous operation. - - - - Interface for handler containers that provide context and resources for update handlers. - Contains all necessary information and services that handlers need during execution. - - - - - Gets the being handled. - - - - - Gets the used for this handler. - - - - - Gets the extra data associated with the handler execution. - - - - - Gets the for this handler. - - - - - Gets the for awaiting operations. - - - - - Factory interface for creating handler containers. - Provides a way to create handler containers with specific providers and handler information. - - - - - Creates a new for the specified awaiting provider and handler info. - - The for the handler. - A new instance. - - - - Abstraction for update handlers, providing execution and lifetime management for Telegram updates. - - - - - Gets the that this handler processes. - - - - - Gets the associated with this handler instance. - - - - - Executes the handler logic and marks the lifetime as ended after execution. - - - The cancellation token. - A representing the asynchronous operation. - - - - Handles failed filters during handler describing. - Use to control how router should treat this fail. - to silently continue decribing. - to stop\break desribing sequence. - - - - - - - - - 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. - - - - - Gets the that this handler processes. - - - - - Gets the associated with this handler instance. - - - - - - - - - - - - - - Executes the handler logic and marks the lifetime as ended after execution. - - - The cancellation token. - A representing the asynchronous operation. - - - - Executes the handler logic for the given container and cancellation token. - - The for the update. - The cancellation token. - A representing the asynchronous operation. - - - - Dispose resources of this handler. Override if needed - - - Return if dispose was successfull and garbage collecting for this object can be supressed - - - - Handles failed filters during handler describing. - Use to control how router should treat this fail. - to silently continue decribing. - to stop\break desribing sequence. - - - - - - - - - Contains information about a filter that failed during execution. @@ -4242,7 +5165,7 @@ Whether the filter failed. The exception that occurred during filter execution, if any. - + Contains information about a filter that failed during execution. Provides details about the filter, its failure status, and any associated exception. @@ -4280,7 +5203,7 @@ The handler descriptor that generated this report. The filter execution context. - + Represents a report of filter fallback information for debugging and error handling. Contains detailed information about which filters failed and why during handler execution. @@ -4412,13 +5335,13 @@ - + Initializes new instance of - + Initializes new instance of @@ -4467,7 +5390,7 @@ IMPORTANT! You can have only ONE instance of this handler. - + @@ -4545,7 +5468,7 @@ This handler will be triggered when users send messages in chats. - + Checks if the update contains a valid message. @@ -4805,129 +5728,6 @@ Gets the update router for handling incoming updates. - - - Centralized logging system for Telegrator. - Provides static access to logging functionality with adapter support. - - - - - Gets the current adapters count. - - - - - Minimal level of logging messages. - Any messages below thi value will not be writen! - - - - - Adds a logger adapter to the centralized logging system. - - The logger adapter to add. - - - - Removes a logger adapter from the centralized logging system. - - The logger adapter to remove. - - - - Clears all logger adapters. - - - - - Logs a message to all registered adapters. - - The log level. - The message to log. - Optional exception. - - - - - Logs a trace message to all registered adapters. - - The message to log. - - - - Logs a trace message to all registered adapters. - - The message to log. - - - - - Logs a debug message to all registered adapters. - - The message to log. - - - - Logs a debug message to all registered adapters. - - The message to log. - - - - - Logs an information message to all registered adapters. - - The message to log. - - - - Logs an information message to all registered adapters. - - The message to log. - - - - - Logs a warning message to all registered adapters. - - The message to log. - - - - Logs a warning message to all registered adapters. - - The message to log. - - - - - Logs an error message to all registered adapters. - - The message to log. - Optional exception. - - - - Logs an error message to all registered adapters. - - The message to log. - - - - - Logs an error message with exception only to all registered adapters. - - The exception to log. - - - - Logs an error message to all registered adapters. - - The message to log. - Optional exception. - - Console logger implementation that writes to System.Console. @@ -5002,831 +5802,128 @@ - + - Descriptor for creating handlers from methods + Centralized logging system for Telegrator. + Provides static access to logging functionality with adapter support. - - + - Initializes new instance of + Gets the current adapters count. - - + - Contains information about a described handler, including its context, client, and execution logic. + Minimal level of logging messages. + Any messages below thi value will not be writen! - + - descriptor from that handler was described from + Adds a logger adapter to the centralized logging system. + The logger adapter to add. - + - The update router associated with this handler. + Removes a logger adapter from the centralized logging system. + The logger adapter to remove. - + - The awaiting provider to fetch new updates inside handler + Clears all logger adapters. - + - The Telegram bot client used for this handler. + Logs a message to all registered adapters. + The log level. + The message to log. + Optional exception. + - + - The handler instance being described. + Logs a trace message to all registered adapters. + The message to log. - + - Extra data associated with the handler execution. + Logs a trace message to all registered adapters. + The message to log. + - + - List of completed filters for this handler. + Logs a debug message to all registered adapters. + The message to log. - + - The update being handled. + Logs a debug message to all registered adapters. + The message to log. + - + - Lifetime token for the handler instance. + Logs an information message to all registered adapters. + The message to log. - + - Display string for the handler (for debugging or logging). + Logs an information message to all registered adapters. + The message to log. + - + - The final execution result. + Logs a warning message to all registered adapters. + The message to log. - + - Initializes a new instance of the class. + Logs a warning message to all registered adapters. - descriptor from that handler was described from - - The update router. - The Telegram bot client. - The handler instance. - The filter execution context. - Optional display string. + The message to log. + - - - - - - Manages the execution of pre and post-execution aspects for a handler. - This class coordinates between self-processing (handler implements interfaces) - and typed processing (external processor classes). - - - - - Gets the type of the external pre-processor, if specified via . - - - - - Gets the type of the external post-processor, if specified via . - - - - - Initializes a new instance of the class. - - The type of external pre-processor, if any. - The type of external post-processor, if any. - - - - Executes the pre-execution aspect for the handler. - - The handler instance. - The handler container with update context. - - A indicating whether execution should continue. - Thrown when handler claims to implement but doesn't. - - - - Executes the post-execution aspect for the handler. - - The handler instance. - The handler container with update context. - - A indicating the final execution result. - Thrown when handler claims to implement but doesn't. - - - - Represents a set of filters for a handler descriptor, including update and state keeper validators. - - - - - Validator for the update object. - - - - - Validator for the state keeper. - - - - - Array of update filters. - - - - - Initializes a new instance of the class. - - Validator for the update object. - Validator for the state keeper. - Array of update filters. - - - - Validates the filter context using all filters in the set. - - The filter execution context. - - - True if all filters pass; otherwise, false. - - - - Represents an indexer for handler descriptors, containing importance and priority information. - - - - - Represents an indexer for handler descriptors, containing importance and priority information. - - - - - Index of this descriptor when it was added to router - - - - - Of this handlert type - - - - - The priority of the handler. - - - - - Initializes a new instance of the struct from a handler attribute. - - - The handler attribute. - - - - Returns a new with updated priority. - - The new priority value. - A new instance. - - - - Returns a new with updated importance. - - The new importance value. - A new instance. - - - - Returns a new with updated RouterIndex. - - - A new instance. - - - - Compares this instance to another . - - The other indexer to compare to. - An integer indicating the relative order. - - - - Returns a string representation of the indexer. - - A string in the format (C:importance, P:priority). - - - - Specifies the type of handler descriptor. - - - - - General handler descriptor. - - - - - Keyed handler descriptor (uses a service key). - - - - - Implicit handler descriptor. - - - - - Singleton handler descriptor (single instance). - - - - - Describes a handler, its type, filters, and instantiation logic. - - - - - The type of the descriptor. - - - - - The type of the handler. - - - - - The update type handled by this handler. - - - - - The indexer for handler concurrency and priority. - - - - - Gets or sets a value indicating whether to form a fallback report. - - - - - The set of filters associated with this handler. - - - - - Gets or sets the aspects configuration for this handler. - Contains pre and post-execution processors if the handler uses the aspect system. - - - - - The service key for keyed handlers. - - - - - Factory for creating handler instances. - - - - - Singleton instance of the handler, if applicable. - - - - - Display string for the handler (for debugging or logging). - - - - - Gets or sets a function for 'lazy' handlers initialization - - - - - Initializes a new instance of the class with the specified descriptor type and handler type. - Automatically inspects the handler type to extract attributes, filters, and configuration. - - The type of the descriptor - The type of the handler to describe - - Thrown when the handler type is not compatible with the expected handler type - - - - Initializes a new instance of the class as a keyed handler with the specified service key. - - The type of the handler to describe - The service key for dependency injection - Thrown when is null - - - - Initializes a new instance of the class with all basic properties. - - The type of the descriptor - The type of the handler - The type of update this handler processes - The indexer for handler concurrency and priority - The set of filters associated with this handler - - - - Initializes a new instance of the class with singleton instance support. - - The type of the descriptor - The type of the handler - The type of update this handler processes - The indexer for handler concurrency and priority - The set of filters associated with this handler - The service key for dependency injection - The singleton instance of the handler - Thrown when or is null - - - - Initializes a new instance of the class with instance factory support. - - The type of the descriptor - The type of the handler - The type of update this handler processes - The indexer for handler concurrency and priority - The set of filters associated with this handler - Factory for creating handler instances - Thrown when is null - - - - Initializes a new instance of the class with service key and instance factory support. - - The type of the descriptor - The type of the handler - The type of update this handler processes - The indexer for handler concurrency and priority - The set of filters associated with this handler - The service key for dependency injection - Factory for creating handler instances - Thrown when or is null - - - - Initializes a new instance of the class with polling handler attribute and filters. - - The type of the descriptor - The type of the handler - The polling handler attribute containing configuration - Optional array of filters to apply - Optional state keeping filter - - - - Initializes a new instance of the class with polling handler attribute, filters, and singleton instance. - - The type of the descriptor - The type of the handler - The polling handler attribute containing configuration - Optional array of filters to apply - Optional state keeping filter - The service key for dependency injection - The singleton instance of the handler - Thrown when or is null - - - - Initializes a new instance of the class with polling handler attribute, filters, and instance factory. - - The type of the descriptor - The type of the handler - The polling handler attribute containing configuration - Optional array of filters to apply - Optional state keeping filter - Factory for creating handler instances - Thrown when is null - - - - Initializes a new instance of the class with polling handler attribute, filters, service key, and instance factory. - - The type of the descriptor - The type of the handler - The polling handler attribute containing configuration - Optional array of filters to apply - Optional state keeping filter - The service key for dependency injection - Factory for creating handler instances - Thrown when or is null - - - - Initializes a new instance of the class with validation filter support. - - The type of the descriptor - The type of the handler - The type of update this handler processes - The indexer for handler concurrency and priority - Optional validation filter - Optional array of filters to apply - Optional state keeping filter - - - - Initializes a new instance of the class with validation filter and singleton instance support. - - The type of the descriptor - The type of the handler - The type of update this handler processes - The indexer for handler concurrency and priority - Optional validation filter - Optional array of filters to apply - Optional state keeping filter - The service key for dependency injection - The singleton instance of the handler - Thrown when or is null - - - - Initializes a new instance of the class with validation filter and instance factory support. - - The type of the descriptor - The type of the handler - The type of update this handler processes - The indexer for handler concurrency and priority - Optional validation filter - Optional array of filters to apply - Optional state keeping filter - Factory for creating handler instances - Thrown when is null - - - - Initializes a new instance of the class with validation filter, service key, and instance factory support. - - The type of the descriptor - The type of the handler - The type of update this handler processes - The indexer for handler concurrency and priority - Optional validation filter - Optional array of filters to apply - Optional state keeping filter - The service key for dependency injection - Factory for creating handler instances - Thrown when or is null - - - - Sets singleton instance of this descriptor - Throws exception if instance already set - - - - - - - Tries to set singleton instance of this descriptor - - - - - - - - - - The collection containing the 's. Used to route 's in - - - - - Gets a value indicating whether the collection is read-only. - - - - - Gets the of handlers in this collection. - - - - - Gets count of registered handlers in list - - - - - Gets or sets the at the specified index. - - - - - - - Initializes a new instance of the class without a specific . - - - - - Initializes a new instance of the class. - - The update type for the handlers. - The collecting options. - - - - Adds a new to the collection. - - The handler descriptor to add. - Thrown if the collection is frozen. - Thrown if the update type does not match. - - - - Checks if the collection contains a with the specified . - - The descriptor indexer. - True if the descriptor exists; otherwise, false. - - - - Removes the with the specified from the collection. - - The descriptor indexer. - True if the descriptor was removed; otherwise, false. - - - - Removes the from the collection. - - - - - - - Removes all descriptos from the - - - - - Freezes the and prohibits adding new elements to it. - - - - - - - - - - - Provides methods for inspecting handler types and retrieving their attributes and filters. - - - - - Gets handler's display name - - - - - - - Gets the handler attribute from the specified member info. - - The member info representing the handler type. - The handler attribute. - - - - Gets the state keeper attribute from the specified member info, if present. - - The member info representing the handler type. - The state keeper attribute, or null if not present. - - - - Gets all filter attributes for the specified handler type and update type. - - The member info representing the handler type. - The valid update type. - An enumerable of filter attributes. - - - - Gets the aspects configuration for the specified handler type. - Inspects the handler for both self-processing (implements interfaces) and typed processing (uses attributes). - - The type of the handler to inspect. - A containing the aspects configuration. - - - - Provider for managing awaiting handlers that can wait for specific update types. - - - - - Registers the usage of a handler and returns a disposable object to manage its lifetime. - - The to use. - An that manages the handler's usage lifetime. - - - - Interface for providers that collect and manage handler collections. - Provides access to a collection of handlers for various processing operations. - - - - - Gets the collection of handlers managed by this provider. - - - - - Collection class for managing handler descriptors organized by update type. - Provides functionality for collecting, adding, and organizing handlers. - - - - - Gets the collection of 's allowed by registered handlers - - - - - Gets the collection of keys for the handler lists. - - - - - Gets the collection of values. - - - - - Gets the for the specified . - - The update type key. - The handler descriptor list for the given update type. - - - - Adds a to the collection and returns the updated collection. - - The handler descriptor to add. - The updated . - - - - Combines and . - Provides functionality of collecting, organizing and resolving handlers instances. - - - - - Provides methods to retrieve and describe handler information for updates. - - - - - Gets the collection of 's allowed by registered handlers - - - - - - - - - - - - - Instantiates a handler for the given descriptor, using the appropriate creation strategy based on descriptor type. - Supports singleton, implicit, keyed, and general descriptor types with different instantiation patterns. - - The handler descriptor. - - An instance of for the descriptor - - - - Determines whether the provider contains any handlers. - - True if the provider is empty; otherwise, false. - - - - Interface for polling providers that manage both regular and awaiting handlers. - Provides access to handlers for different types of update processing during polling operations. - - - - - Gets the that manages handlers for polling. - - - - - Gets the that manages awaiting handlers for polling. - - - - - Interface for handling exceptions that occur during update routing operations. - Provides a centralized way to handle and log errors that occur during bot operation. - - - - - Handles exceptions that occur during update routing. - - The instance. - The exception that occurred. - The indicating the source of the error. - The cancellation token. - - - - Represents a delegate for when a handler is enqueued. - - The for the enqueued handler. - - - - Represents a delegate for when a handler is executing. - - The for the executing handler. - - - - Provides a pool for managing the execution and queuing of update handlers. - - - - - Occurs when a handler is enqueued. - - - - - Occurs when a handler is entering execution. - - - - - Enqueues a collection of handlers for execution. - - The handlers to enqueue. - - - - Interface for update routers that handle incoming updates and manage handler execution. - Combines update handling capabilities with polling provider functionality and exception handling. - - - + - Gets the for the router. + Logs an error message to all registered adapters. + The message to log. + Optional exception. - + - Gets the that manages handler execution. + Logs an error message to all registered adapters. + The message to log. + - + - Gets or sets the for handling exceptions. + Logs an error message with exception only to all registered adapters. + The exception to log. - + - Default hand;er container factory + Logs an error message to all registered adapters. + The message to log. + Optional exception. + @@ -6042,57 +6139,57 @@ Optional. The maximum number of users to be selected; 1-10. Defaults to 1. - + - Delegate used to handle exception + Delegate used to handle exception - + - Realizes using function delegate + Realizes using function delegate - + - Realizes using function delegate + Realizes using function delegate - + - + - Reactive implementation of for polling updates from Telegram. + Reactive implementation of for polling updates from Telegram. Provides custom update receiving logic with error handling and configuration options. The Telegram bot client for making API requests. Optional receiver options for configuring update polling behavior. - + - Reactive implementation of for polling updates from Telegram. + Reactive implementation of for polling updates from Telegram. Provides custom update receiving logic with error handling and configuration options. The Telegram bot client for making API requests. Optional receiver options for configuring update polling behavior. - + Gets the receiver options for configuring update polling behavior. - + Gets the Telegram bot client for making API requests. - + Receives updates from Telegram using long polling. Handles update processing, error handling, and cancellation. @@ -6101,107 +6198,95 @@ The cancellation token to stop receiving updates. A task representing the asynchronous update receiving operation. - - + - Starts receiving s invoking for each . - - This method will block if awaited. - - - The used for processing s - The with which you can stop receiving - A that will be completed when cancellation will be requested through - - - - Implementation of that manages the execution of handlers. + Implementation of that manages the execution of handlers. Provides thread-safe queuing and execution of handlers with configurable concurrency limits. - + Synchronization object for thread-safe operations. - + Semaphore for controlling the number of concurrently executing handlers. - + The bot configuration options. - + The global cancellation token for stopping all operations. - + Flag indicating whether the pool has been disposed. - + - + - + - Initializes a new instance of the class. + Initializes a new instance of the class. The update handler that claims updates The bot configuration options. The global cancellation token. - + - + Disposes of the handlers pool and releases all resources. - + - Implementation of that routes updates to appropriate handlers. + Implementation of that routes updates to appropriate handlers. Manages the distribution of updates between regular handlers and awaiting handlers. - + - + - + - + - + - + - + - Initializes a new instance of the class. + Initializes a new instance of the class. The provider for regular handlers. The provider for awaiting handlers. The bot configuration options. - + - Initializes a new instance of the class with a custom handlers pool. + Initializes a new instance of the class with a custom handlers pool. The provider for regular handlers. The provider for awaiting handlers. @@ -6209,7 +6294,7 @@ The custom handlers pool to use. - + Handles errors that occur during update processing. @@ -6219,7 +6304,7 @@ The cancellation token. A task representing the asynchronous error handling operation. - + Handles incoming updates by routing them to appropriate handlers. @@ -6228,7 +6313,7 @@ The cancellation token. A task representing the asynchronous update handling operation. - + Gets the handlers that match the specified update, using the provided router and client. Searches for handlers by update type, falling back to Unknown type if no specific handlers are found. @@ -6239,7 +6324,7 @@ A collection of described handler information for the update - + Describes all handler descriptors for a given update context. Processes descriptors in reverse order and respects the ExecuteOnlyFirstFoundHanlder option. @@ -6251,7 +6336,7 @@ A collection of described handler information - + Describes a single handler descriptor for a given update context. Validates the handler's filters against the update and creates a handler instance if validation passes. @@ -6264,7 +6349,7 @@ The described handler info if validation passes; otherwise, null - + Methos used to log received object @@ -6290,10 +6375,10 @@ List of handler descriptors for awaiting handlers. - + - + @@ -6304,7 +6389,7 @@ The list of handler descriptors. The handler descriptor to manage. - + Token for managing the lifetime of a handler in the awaiting provider. Implements IDisposable to automatically remove the handler when disposed. @@ -6330,7 +6415,7 @@ Optional configuration options for handler collecting. - + Collection class for managing handler descriptors organized by update type. Provides functionality for collecting, adding, and organizing handlers. @@ -6374,7 +6459,7 @@ - + Adds a handler descriptor to the collection. @@ -6382,14 +6467,14 @@ This collection instance for method chaining. Thrown when the handler type doesn't have a parameterless constructor and MustHaveParameterlessCtor is true. - + - Gets the for the specified . + Gets the for the specified . The handler descriptor. The handler descriptor list containing the descriptor. - + Checks for intersecting command aliases and handles them according to configuration. @@ -6399,14 +6484,14 @@ Provides functionality of incrementally collecting, organizing and resolving handlers instances. - Minimum implementation of . Abstract class, still requires handler instance resolving. + Minimum implementation of . Abstract class, still requires handler instance resolving. - + Provides functionality of incrementally collecting, organizing and resolving handlers instances. - Minimum implementation of . Abstract class, still requires handler instance resolving. + Minimum implementation of . Abstract class, still requires handler instance resolving. @@ -6447,30 +6532,30 @@ - + - + - Gets the for the specified . + Gets the for the specified . The handler descriptor. The handler descriptor list containing the descriptor. - + Checks for intersecting command aliases and handles them according to configuration. The handler descriptor to check for command aliases. Thrown when intersecting command aliases are found and ExceptIntersectingCommandAliases is enabled. - + - + @@ -6494,7 +6579,7 @@ Configuration options for the bot and handler execution behavior. - + Initializes a new instance of with the specified handler collections and configuration. @@ -6502,7 +6587,7 @@ Configuration options for the bot and handler execution Thrown when options or botInfo is null - + Initializes a new instance of with the specified handler collections and configuration. @@ -6510,28 +6595,16 @@ Configuration options for the bot and handler execution Thrown when options or botInfo is null - + Thrown when the descriptor type is not recognized - + - - - Interface for classes that can provide custom handler descriptors. - Allows classes to define their own handler description logic beyond the standard reflection-based approach. - - - - - Describes the handlers provided by this class. - - A collection of handler descriptors. - Represents handler results, allowing to communicate with router and control aspect execution @@ -6557,8 +6630,8 @@ Represents 'success' Inside - let handler's main block be executed - Inside - tells that he can stop describing, as needed handler was found - Inside - let continue describing + Inside - tells that he can stop describing, as needed handler was found + Inside - let continue describing @@ -6568,7 +6641,7 @@ Represents 'fault' or 'error'. Use cases: Inside - interupts execution of handler, main block and wont be executed - Inside - interupts 's describing sequence + Inside - interupts 's describing sequence @@ -6577,8 +6650,8 @@ Represents 'continue'. Use cases: - Inside - let continue describing - Inside - Tells to continue describing handlers + Inside - let continue describing + Inside - Tells to continue describing handlers @@ -6587,7 +6660,7 @@ Represents 'chain'. Use cases: - Inside - Tells to continue describing handlers and execute only handlers of exact type + Inside - Tells to continue describing handlers and execute only handlers of exact type @@ -6699,28 +6772,28 @@ - Checks if a type implements the interface. + Checks if a type implements the interface. The type to check. True if the type implements ICustomDescriptorsProvider; otherwise, false. - Checks if is a + Checks if is a - Checks if is a descendant of class + Checks if is a descendant of class - Checks if is an implementation of class or its descendants + Checks if is an implementation of class or its descendants @@ -6864,105 +6937,6 @@ The chat ID as a long value. Thrown when the update does not contain a valid chat ID. - - - Defines a resolver for extracting a key from an update for state keeping purposes. - - The type of the key. - - - - Resolves a key from the specified . - - The update to resolve the key from. - The resolved key. - - - - Base class for managing state associated with updates and keys. - - The type of the key used for state resolution. - The type of the state. - - - - Gets or sets the key resolver used to resolve keys from updates. - - - - - Gets the default state value. - - - - - Sets the state for the specified update. - - The update to use as a key source. - The new state value. - - - - Gets the state for the specified update. - - The update to use as a key source. - The state value. - - - - Tries to get the state for the specified update. - - The update to use as a key source. - When this method returns, contains the state value if found; otherwise, the default value. - True if the state was found; otherwise, false. - - - - Determines whether a state exists for the specified update. - - The update to use as a key source. - True if the state exists; otherwise, false. - - - - Creates a state for the specified update using the default state value. - - The update to use as a key source. - - - - Deletes the state for the specified update. - - The update to use as a key source. - - - - Moves the state forward for the specified update. - - The update to use as a key source. - - - - Moves the state backward for the specified update. - - The update to use as a key source. - - - - Moves the state forward for the specified current state and key. - - The current state value. - The key. - The new state value. - - - - Moves the state backward for the specified current state and key. - - The current state value. - The key. - The new state value. - State keeper implementation for enum-based states. @@ -6994,7 +6968,7 @@ Provides extension methods for managing string states in handler containers. - + Gets the enum state keeper for the specified enum type. @@ -7002,21 +6976,21 @@ The handler container (unused parameter for extension method syntax). The enum state keeper instance. - + Creates a new enum state for the current update. The enum type for state management. The handler container. - + Deletes the enum state for the current update. The enum type for state management. The handler container. - + Sets the enum state to a specific value for the current update. @@ -7024,40 +6998,40 @@ The handler container. The new state value. If null, uses the default state. - + Moves the enum state forward to the next value in the enum sequence. The enum type for state management. The handler container. - + Moves the enum state backward to the previous value in the enum sequence. The enum type for state management. The handler container. - + Gets the numeric state keeper instance associated with the handler container. The handler container instance - The instance + The instance - + Creates a new numeric state for the current update being handled. The handler container instance - + Deletes the numeric state for the current update being handled. The handler container instance - + Sets the numeric state for the current update being handled. If the new state is null, uses the default state from the state keeper. @@ -7065,38 +7039,38 @@ The handler container instance The new numeric state to set, or null to use default - + Moves the numeric state forward by incrementing the current value. The handler container instance - + Moves the numeric state backward by decrementing the current value. The handler container instance - + Gets the string state keeper instance associated with the handler container. The handler container instance - The instance + The instance - + Creates a new string state for the current update being handled. The handler container instance - + Deletes the string state for the current update being handled. The handler container instance - + Sets the string state for the current update being handled. If the new state is null, uses the default state from the state keeper. @@ -7107,7 +7081,7 @@ State keeper that manages numeric (integer) states for chat sessions. - Inherits from with long keys and int states. + Inherits from with long keys and int states. Provides automatic increment/decrement functionality for state transitions. @@ -7169,13 +7143,13 @@ - Implementation of that provides bot information. + Implementation of that provides bot information. Contains metadata about the Telegram bot including user details. - Implementation of that provides bot information. + Implementation of that provides bot information. Contains metadata about the Telegram bot including user details. @@ -7321,7 +7295,7 @@ Provides convenient methods for creating awaiter builders and state keeping. - + Creates an awaiter builder for a specific update type. @@ -7330,28 +7304,28 @@ The type of update to await. An awaiter builder for the specified update type. - + Creates an awaiter builder for any update type. The handler container. An awaiter builder for any update type. - + Creates an awaiter builder for message updates. The handler container. An awaiter builder for message updates. - + Creates an awaiter builder for callback query updates. The handler container. An awaiter builder for callback query updates. - + Gets a state keeper instance for the specified types. @@ -7366,7 +7340,7 @@ Extensions methods for Awaiter Handler Builders - + Awaits an update using the chat id key resolver and cancellation token. @@ -7375,7 +7349,7 @@ - + Awaits an update using the sender id key resolver and cancellation token. @@ -7390,7 +7364,7 @@ Provides convenient methods for creating awaiter builders. - + Creates an awaiter handler builder for a specific update type. @@ -7400,7 +7374,7 @@ The update that triggered the awaiter creation. An awaiter handler builder for the specified update type. - + Creates an awaiter builder for any update type. @@ -7408,7 +7382,7 @@ An awaiter builder for any update type. - + Creates an awaiter builder for message updates. @@ -7416,7 +7390,7 @@ An awaiter builder for message updates. - + Creates an awaiter builder for callback query updates. @@ -7429,7 +7403,7 @@ Extesions method for handlers providers - + Gets the list of bot commands supported by the provider. @@ -7441,7 +7415,7 @@ Provides convenient methods for creating implicit handlers. - + Collects all public handlers from the current app domain. Scans for types that implement handlers and adds them to the collection. @@ -7449,7 +7423,7 @@ This collection instance for method chaining. Thrown when the entry assembly cannot be found. - + Collects all public handlers from the calling this function assembly. Scans for types that implement handlers and adds them to the collection. @@ -7457,7 +7431,7 @@ This collection instance for method chaining. Thrown when the entry assembly cannot be found. - + Creates a handler builder for a specific update type. @@ -7466,28 +7440,28 @@ The type of update to handle. A handler builder for the specified update type. - + Creates a handler builder for any update type. The handlers collection. A handler builder for any update type. - + Creates a handler builder for message updates. The handlers collection. A handler builder for message updates. - + Creates a handler builder for callback query updates. The handlers collection. A handler builder for callback query updates. - + Adds a handler type to the collection. @@ -7495,7 +7469,7 @@ The type of handler to add. This collection instance for method chaining. - + Adds a handler type to the collection. @@ -7504,7 +7478,7 @@ This collection instance for method chaining. Thrown when the type is not a valid handler implementation. - + Creates implicit handler from method diff --git a/src/Telegrator.Hosting.Web/Hosting.Web/TelegramBotWebHostBuilder.cs b/src/Telegrator.Hosting.Web/Hosting.Web/TelegramBotWebHostBuilder.cs index 557cd64..3f93927 100644 --- a/src/Telegrator.Hosting.Web/Hosting.Web/TelegramBotWebHostBuilder.cs +++ b/src/Telegrator.Hosting.Web/Hosting.Web/TelegramBotWebHostBuilder.cs @@ -7,7 +7,6 @@ using Microsoft.Extensions.Options; using Telegram.Bot; using Telegrator; using Telegrator.Core; -using Telegrator.Hosting.Configuration; using Telegrator.Providers; #pragma warning disable IDE0001 diff --git a/src/Telegrator.Hosting/Hosting/TelegramBotHostBuilder.cs b/src/Telegrator.Hosting/Hosting/TelegramBotHostBuilder.cs index 541a529..444912c 100644 --- a/src/Telegrator.Hosting/Hosting/TelegramBotHostBuilder.cs +++ b/src/Telegrator.Hosting/Hosting/TelegramBotHostBuilder.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Telegrator.Core; -using Telegrator.Hosting.Providers; +using Telegrator.Providers; #pragma warning disable IDE0001 namespace Telegrator.Hosting diff --git a/src/Telegrator.Hosting/Providers/HostHandlersCollection.cs b/src/Telegrator.Hosting/Providers/HostHandlersCollection.cs index e8c8eb1..be0c8b0 100644 --- a/src/Telegrator.Hosting/Providers/HostHandlersCollection.cs +++ b/src/Telegrator.Hosting/Providers/HostHandlersCollection.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.DependencyInjection; using System.Reflection; -using Telegrator.Configuration; using Telegrator.Core; using Telegrator.Core.Descriptors; using Telegrator.Hosting; diff --git a/src/Telegrator.Hosting/TypesExtensions.cs b/src/Telegrator.Hosting/TypesExtensions.cs index 804689d..1dbcbba 100644 --- a/src/Telegrator.Hosting/TypesExtensions.cs +++ b/src/Telegrator.Hosting/TypesExtensions.cs @@ -17,7 +17,6 @@ using Telegrator.Core; using Telegrator.Core.Descriptors; using Telegrator.Handlers; using Telegrator.Hosting; -using Telegrator.Hosting.Configuration; using Telegrator.Logging; using Telegrator.Polling; using Telegrator.Providers; diff --git a/src/Telegrator.Localized/ILocalizedMessageHandler.cs b/src/Telegrator.Localized/ILocalizedMessageHandler.cs index 6e739e7..beafbee 100644 --- a/src/Telegrator.Localized/ILocalizedMessageHandler.cs +++ b/src/Telegrator.Localized/ILocalizedMessageHandler.cs @@ -1,5 +1,4 @@ using Telegram.Bot.Types; -using Telegrator.Handlers.Components; namespace Telegrator.Localized { diff --git a/src/Telegrator/Core/Descriptors/HandlerDescriptorList.cs b/src/Telegrator/Core/Descriptors/HandlerDescriptorList.cs index 0975118..44f84b2 100644 --- a/src/Telegrator/Core/Descriptors/HandlerDescriptorList.cs +++ b/src/Telegrator/Core/Descriptors/HandlerDescriptorList.cs @@ -1,8 +1,6 @@ using System.Collections; using Telegram.Bot.Types; using Telegram.Bot.Types.Enums; -using Telegrator.Configuration; -using Telegrator.Core; namespace Telegrator.Core.Descriptors { diff --git a/src/Telegrator/Core/Handlers/BranchingUpdateHandler.cs b/src/Telegrator/Core/Handlers/BranchingUpdateHandler.cs index f5448aa..5a71e4d 100644 --- a/src/Telegrator/Core/Handlers/BranchingUpdateHandler.cs +++ b/src/Telegrator/Core/Handlers/BranchingUpdateHandler.cs @@ -5,7 +5,6 @@ using Telegrator.Core.Attributes; using Telegrator.Core.Descriptors; using Telegrator.Core.Filters; using Telegrator.Handlers; -using Telegrator.MadiatorCore; namespace Telegrator.Core.Handlers { diff --git a/src/Telegrator/Core/Handlers/IHandlerContainerFactory.cs b/src/Telegrator/Core/Handlers/IHandlerContainerFactory.cs index 908beaf..1b7c601 100644 --- a/src/Telegrator/Core/Handlers/IHandlerContainerFactory.cs +++ b/src/Telegrator/Core/Handlers/IHandlerContainerFactory.cs @@ -1,5 +1,4 @@ using Telegrator.Core.Descriptors; -using Telegrator.MadiatorCore; namespace Telegrator.Core.Handlers { diff --git a/src/Telegrator/Mediation/UpdateRouter.cs b/src/Telegrator/Mediation/UpdateRouter.cs index 2bd33b9..f78d2e3 100644 --- a/src/Telegrator/Mediation/UpdateRouter.cs +++ b/src/Telegrator/Mediation/UpdateRouter.cs @@ -1,5 +1,4 @@ -using System.Runtime.InteropServices; -using System.Text; +using System.Text; using Telegram.Bot; using Telegram.Bot.Polling; using Telegram.Bot.Types; @@ -10,7 +9,6 @@ using Telegrator.Core.Filters; using Telegrator.Core.Handlers; using Telegrator.Handlers.Diagnostics; using Telegrator.Logging; -using Telegrator.Polling; namespace Telegrator.Mediation { diff --git a/src/Telegrator/TelegratorClient.cs b/src/Telegrator/TelegratorClient.cs index f9c2312..fbe2140 100644 --- a/src/Telegrator/TelegratorClient.cs +++ b/src/Telegrator/TelegratorClient.cs @@ -3,7 +3,6 @@ using Telegram.Bot.Polling; using Telegrator.Core; using Telegrator.Logging; using Telegrator.Mediation; -using Telegrator.Polling; using Telegrator.Providers; namespace Telegrator diff --git a/tests/Telegrator.Tests/Collections/CollectionTests.cs b/tests/Telegrator.Tests/Collections/CollectionTests.cs index 086cc2a..dc49321 100644 --- a/tests/Telegrator.Tests/Collections/CollectionTests.cs +++ b/tests/Telegrator.Tests/Collections/CollectionTests.cs @@ -1,7 +1,7 @@ using FluentAssertions; using Telegram.Bot.Types.Enums; using Telegrator.Core.Descriptors; -using Telegrator.Filters.Components; +using Telegrator.Core.Filters; using Xunit; namespace Telegrator.Tests.Collections diff --git a/tests/Telegrator.Tests/Filters/FilterTests.cs b/tests/Telegrator.Tests/Filters/FilterTests.cs index e764f19..fcf3b93 100644 --- a/tests/Telegrator.Tests/Filters/FilterTests.cs +++ b/tests/Telegrator.Tests/Filters/FilterTests.cs @@ -1,7 +1,7 @@ using FluentAssertions; using Telegram.Bot.Types; +using Telegrator.Core.Filters; using Telegrator.Filters; -using Telegrator.Filters.Components; using Xunit; #pragma warning disable CS8625