# PRTelegramBot

## PRTelegramBot\_EN

- [PRTelegramBot](https://prethink.gitbook.io/prtelegrambot/readme.md): A .NET framework for building Telegram bots on top of Telegram.Bot: attribute-based command routing, menus, middleware, DI and background tasks.
- [F.A.Q.](https://prethink.gitbook.io/prtelegrambot/faq.md): Problems people run into most often, and what fixes them.
- [Migrating to 1.0](https://prethink.gitbook.io/prtelegrambot/migrating-to-1.0.md): What you need to change in your own code when moving from 0.9.x to 1.0.0.
- [Getting started](https://prethink.gitbook.io/prtelegrambot/getting-started.md): Everything you need to do to get your first bot running.
- [Webhook](https://prethink.gitbook.io/prtelegrambot/getting-started/webhook.md): Running a bot behind a public URL instead of polling.
- [Debugging a webhook](https://prethink.gitbook.io/prtelegrambot/getting-started/webhook/debugging-webhook.md): Testing a webhook bot from your development machine.
- [PRBotBuilder — creating bots](https://prethink.gitbook.io/prtelegrambot/prbotbuilder.md): The fluent builder that creates and configures a bot.
- [Dependency injection](https://prethink.gitbook.io/prtelegrambot/dependency-injection.md): Since version 0.5.0 handlers can be resolved through a dependency injection container.
- [Component resolution priorities](https://prethink.gitbook.io/prtelegrambot/dependency-injection/resolution-priorities.md): Which implementation wins when a component is available from more than one place.
- [Command handling](https://prethink.gitbook.io/prtelegrambot/command-handling.md): The three ways the framework routes an incoming message to your code.
- [Reply commands](https://prethink.gitbook.io/prtelegrambot/command-handling/reply-commands.md): Reacting to the plain text a user sends.
- [Creating a reply menu](https://prethink.gitbook.io/prtelegrambot/command-handling/reply-commands/reply-menu.md): Turning reply commands into a keyboard the user can tap.
- [Dynamic reply commands from a JSON file](https://prethink.gitbook.io/prtelegrambot/command-handling/reply-commands/dynamic-reply-commands.md): Reply commands whose text lives in a JSON file instead of in the code.
- [Slash commands](https://prethink.gitbook.io/prtelegrambot/command-handling/slash-commands.md): Handling clickable /commands, with typed arguments.
- [Inline commands](https://prethink.gitbook.io/prtelegrambot/command-handling/inline-commands.md): Handling presses on inline buttons, and the 64-byte limit behind them.
- [Creating an inline menu](https://prethink.gitbook.io/prtelegrambot/command-handling/inline-commands/inline-menu.md): Building inline keyboards, and getting past the 64-byte callback\_data limit.
- [Handling inline commands](https://prethink.gitbook.io/prtelegrambot/command-handling/inline-commands/handling-inline-commands.md): Writing the handler that receives an inline button press.
- [InlineCallback with confirmation](https://prethink.gitbook.io/prtelegrambot/command-handling/inline-commands/confirmation.md): Asking the user to confirm before an inline button actually does anything.
- [Instance inline handler](https://prethink.gitbook.io/prtelegrambot/command-handling/inline-commands/instance-handler.md): Handling one inline command with a class instead of a static method.
- [Working with the calendar](https://prethink.gitbook.io/prtelegrambot/command-handling/calendar.md): An inline date picker, built in.
- [Parameters](https://prethink.gitbook.io/prtelegrambot/command-handling/parameters.md): The parameters shared by the handler attributes.
- [Pre-execution checks](https://prethink.gitbook.io/prtelegrambot/command-handling/pre-execution-checks.md): Running your own check before a command executes, and stopping it if the check fails.
- [Custom command handlers](https://prethink.gitbook.io/prtelegrambot/command-handling/custom-handlers.md): Replacing or extending how the framework routes message and callbackQuery updates.
- [Adding and removing commands at runtime](https://prethink.gitbook.io/prtelegrambot/dynamic-command-management.md): Since version 0.5.0 reply, slash and inline handlers can be added and removed while the bot is running.
- [Step-by-step commands](https://prethink.gitbook.io/prtelegrambot/step-by-step-commands.md): Walking a user through a sequence of questions, one message at a time.
- [Paginated messages](https://prethink.gitbook.io/prtelegrambot/paginated-messages.md): One message the user pages through with next and previous buttons.
- [Ephemeral messages](https://prethink.gitbook.io/prtelegrambot/ephemeral-messages.md)
- [Rich messages](https://prethink.gitbook.io/prtelegrambot/rich-messages.md): Sending messages built from blocks — headings, lists, tables, quotations and media.
- [Configuration files for bots](https://prethink.gitbook.io/prtelegrambot/configuration-files.md): Keeping button captions and message texts outside the code.
- [User cache](https://prethink.gitbook.io/prtelegrambot/user-cache.md): Keeping short-lived per-user data between messages.
- [Restricted access to commands](https://prethink.gitbook.io/prtelegrambot/restricted-access.md): Letting a command run only for users who hold the right privileges.
- [Bot administrators](https://prethink.gitbook.io/prtelegrambot/bot-administrators.md): Declaring who administers the bot, and checking it in a command.
- [User white list](https://prethink.gitbook.io/prtelegrambot/user-white-list.md): Restricting the bot to a known set of users.
- [Events](https://prethink.gitbook.io/prtelegrambot/events.md): Reacting to things the framework notices but no command handles.
- [Message events](https://prethink.gitbook.io/prtelegrambot/events/message-events.md): Events raised for each kind of message the bot receives.
- [Update events](https://prethink.gitbook.io/prtelegrambot/events/update-events.md): Events raised for each kind of update, and the two that wrap the whole pipeline.
- [Command events](https://prethink.gitbook.io/prtelegrambot/events/command-events.md): Events raised immediately before and after each kind of command runs.
- [Logging events](https://prethink.gitbook.io/prtelegrambot/events/logging-events.md): Writing to the bot's own log from your code.
- [Event bus](https://prethink.gitbook.io/prtelegrambot/event-bus.md): Broadcasting events between parts of an application without direct references.
- [Using the event bus in PRBackgroundTaskRunner](https://prethink.gitbook.io/prtelegrambot/event-bus/task-runner-example.md): How PRBackgroundTaskRunner subscribes to the bus, and manages its own lifetime.
- [Background tasks](https://prethink.gitbook.io/prtelegrambot/background-tasks.md): Work that runs on a schedule, independently of any incoming update.
- [A task with the metadata attribute](https://prethink.gitbook.io/prtelegrambot/background-tasks/metadata-attribute.md): Declaring a task's schedule with an attribute on the class.
- [A task implementing the metadata interface](https://prethink.gitbook.io/prtelegrambot/background-tasks/metadata-interface.md): A task that carries its own schedule by implementing both interfaces.
- [A task with a separate metadata class](https://prethink.gitbook.io/prtelegrambot/background-tasks/separate-metadata-class.md): Keeping a task's schedule in a class of its own.
- [Middleware](https://prethink.gitbook.io/prtelegrambot/middleware.md): Wrapping the update pipeline with your own code, before and after handling.
- [Execution scope](https://prethink.gitbook.io/prtelegrambot/execution-scope.md): Reaching the current bot, context and services from anywhere in the call stack.
- [Logging](https://prethink.gitbook.io/prtelegrambot/logging.md): Plugging your own ILogger into the framework.
- [Local Server API](https://prethink.gitbook.io/prtelegrambot/local-server-api.md): Pointing a bot at your own Bot API server instead of Telegram's.
- [API](https://prethink.gitbook.io/prtelegrambot/api.md): The framework's public surface, generated from the source.
- [Attributes](https://prethink.gitbook.io/prtelegrambot/api/attributes.md): Attributes the framework recognises on your own types and methods.
- [PRBackgroundTaskAttribute](https://prethink.gitbook.io/prtelegrambot/api/attributes/prbackgroundtaskattribute.md): Background task metadata attribute.
- [Classes](https://prethink.gitbook.io/prtelegrambot/api/classes.md): The classes that make up the framework's public surface.
- [AdminListManager](https://prethink.gitbook.io/prtelegrambot/api/classes/adminlistmanager.md): Administrator manager.
- [BotContext](https://prethink.gitbook.io/prtelegrambot/api/classes/botcontext.md): Bot context.
- [Bot factories](https://prethink.gitbook.io/prtelegrambot/api/classes/bot-factories.md): The factories that decide how a bot receives updates.
- [CommandHandler](https://prethink.gitbook.io/prtelegrambot/api/classes/commandhandler.md): Common command handler.
- [CurrentScope](https://prethink.gitbook.io/prtelegrambot/api/classes/currentscope.md): Provides access to the current state of the context and the bot. Read-only. The stack is managed by BotDataScope.
- [FileInlineConverter](https://prethink.gitbook.io/prtelegrambot/api/classes/fileinlineconverter.md): Converter that stores inline menus in files. Stores the temporary data as files named '{bot id}-{user id}-{command id}'. The files are saved in the 'InlineCallbacks' folder inside the application dire
- [InlineCallbackWithConfirmation](https://prethink.gitbook.io/prtelegrambot/api/classes/inlinecallbackwithconfirmation.md): Lets an inlineCallBack be executed with a confirmation.
- [InlineCopyText](https://prethink.gitbook.io/prtelegrambot/api/classes/inlinecopytext.md): Creates a button that copies the given text to the clipboard when it is pressed.
- [InlineDisabled](https://prethink.gitbook.io/prtelegrambot/api/classes/inlinedisabled.md): Creates a button that is shown but does nothing when it is pressed.
- [InlineKeyboardBuilder](https://prethink.gitbook.io/prtelegrambot/api/classes/inlinekeyboardbuilder.md): Builder for conveniently constructing an InlineKeyboardMarkup. Lets you set keyboard options and add buttons and rows dynamically.
- [JsonSerializerWrapper](https://prethink.gitbook.io/prtelegrambot/api/classes/jsonserializerwrapper.md): Json data serializer.
- [KeyboardBuilderBase](https://prethink.gitbook.io/prtelegrambot/api/classes/keyboardbuilderbase.md): Base class for building keyboards.
- [MediaEditor](https://prethink.gitbook.io/prtelegrambot/api/classes/mediaeditor.md): Edits media that has already been sent, and its caption.
- [MediaSender](https://prethink.gitbook.io/prtelegrambot/api/classes/mediasender.md): Sends media: photos, photo groups, files and media by URL.
- [MessageBuilder](https://prethink.gitbook.io/prtelegrambot/api/classes/messagebuilder.md): Message builder with support for named tokens and positional arguments. Lets you compose strings in the style of \`string.Format(string, object?\[])\`, but extended with tokens such as {QA}, {Dev} and so
- [MessageCopier](https://prethink.gitbook.io/prtelegrambot/api/classes/messagecopier.md): Copies messages between chats.
- [MessageDeleter](https://prethink.gitbook.io/prtelegrambot/api/classes/messagedeleter.md): Deletes messages.
- [MessageEditor](https://prethink.gitbook.io/prtelegrambot/api/classes/messageeditor.md): Edits messages that have already been sent.
- [MessageNotification](https://prethink.gitbook.io/prtelegrambot/api/classes/messagenotification.md): Shows notifications and alerts in response to a callbackQuery.
- [MessageSender](https://prethink.gitbook.io/prtelegrambot/api/classes/messagesender.md): Sends messages to Telegram.
- [MiddlewareBase](https://prethink.gitbook.io/prtelegrambot/api/classes/middlewarebase.md): Base middleware handler.
- [OptionMessage](https://prethink.gitbook.io/prtelegrambot/api/classes/optionmessage.md): Helper class that holds the settings used to send messages in Telegram.
- [PRBackgroundTaskRunner](https://prethink.gitbook.io/prtelegrambot/api/classes/prbackgroundtaskrunner.md): Background task runner.
- [PREventBus](https://prethink.gitbook.io/prtelegrambot/api/classes/preventbus.md): Event bus.
- [PRSettingsProvider](https://prethink.gitbook.io/prtelegrambot/api/classes/prsettingsprovider.md): Provider of the global settings.
- [ReplyKeyboardBuilder](https://prethink.gitbook.io/prtelegrambot/api/classes/replykeyboardbuilder.md): Builder for conveniently constructing a ReplyKeyboardMarkup. Lets you set keyboard options and add buttons and rows dynamically.
- [TelegramInlineConverter](https://prethink.gitbook.io/prtelegrambot/api/classes/telegraminlineconverter.md)
- [ToonSerializerWrapper](https://prethink.gitbook.io/prtelegrambot/api/classes/toonserializerwrapper.md): Toon data serializer.
- [WhiteListManager](https://prethink.gitbook.io/prtelegrambot/api/classes/whitelistmanager.md): White list manager.
- [Callback commands](https://prethink.gitbook.io/prtelegrambot/api/classes/callback-commands.md): The payload types carried inside an inline button's callback data.
- [CalendarTCommand](https://prethink.gitbook.io/prtelegrambot/api/classes/callback-commands/calendartcommand.md): Command that carries a date from the calendar.
- [EntityTCommand](https://prethink.gitbook.io/prtelegrambot/api/classes/callback-commands/entitytcommand.md): Command that carries the entity identifier.
- [PageTCommand](https://prethink.gitbook.io/prtelegrambot/api/classes/callback-commands/pagetcommand.md): Handles a TCommand in page form.
- [TCommandBase](https://prethink.gitbook.io/prtelegrambot/api/classes/callback-commands/tcommandbase.md): Base command.
- [TelegramOptions](https://prethink.gitbook.io/prtelegrambot/api/classes/telegramoptions.md): Telegram bot options.
- [WebHookOptions](https://prethink.gitbook.io/prtelegrambot/api/classes/telegramoptions/webhookoptions.md): Telegram bot options for working over a webhook.
- [Interfaces](https://prethink.gitbook.io/prtelegrambot/api/interfaces.md): The interfaces you implement to replace or extend a part of the framework.
- [IAdminManager](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iadminmanager.md): Interface of the administrator manager.
- [IBotCollection](https://prethink.gitbook.io/prtelegrambot/api/interfaces/ibotcollection.md): Interface for working with the bot collection. Lets you look bots up by various criteria and manage the collection.
- [IBotConfigProvider](https://prethink.gitbook.io/prtelegrambot/api/interfaces/ibotconfigprovider.md): Interface of the bot configuration provider.
- [IBotContext](https://prethink.gitbook.io/prtelegrambot/api/interfaces/ibotcontext.md): Interface of the bot context.
- [ICallbackQueryCommandHandler](https://prethink.gitbook.io/prtelegrambot/api/interfaces/icallbackquerycommandhandler.md): Interface of the handler for callbackQuery commands.
- [IExecuteStep](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iexecutestep.md): Interface for step-by-step command execution.
- [IInlineContent](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iinlinecontent.md): Common interface for inline buttons.
- [IInlineMenuConverter](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iinlinemenuconverter.md): Interface of the InlineCallback converter.
- [IInternalCheck](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iinternalcheck.md): Interface for checking commands before they run.
- [IMessageCommandHandler](https://prethink.gitbook.io/prtelegrambot/api/interfaces/imessagecommandhandler.md): Interface of the handler for message commands.
- [IPRBackgroundTask](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iprbackgroundtask.md): Interface of a background task.
- [IPRBackgroundTaskMetadata](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iprbackgroundtaskmetadata.md): Interface for background task metadata. Holds the information needed to schedule the task and control how it runs without describing its business logic.
- [IPRBackgroundTaskRunner](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iprbackgroundtaskrunner.md): Interface of the background task runner. Responsible for starting, stopping and managing the lifetime of background tasks.
- [IPRGlobalSubscriber](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iprglobalsubscriber.md): Interface of a global subscriber. Used by the EventBus system.
- [IPRSerializer](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iprserializer.md): Interface of the serializer wrapper.
- [IPRSettings](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iprsettings.md): Global settings.
- [IPRTaskRunnerSubscriber](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iprtaskrunnersubscriber.md): Subscriber of the background task runner.
- [IPRUpdateHandler](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iprupdatehandler.md): Telegram update handler.
- [IRegisterCommands](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iregistercommands.md): Interface of the command registrar.
- [IRunningBackgroundTaskData](https://prethink.gitbook.io/prtelegrambot/api/interfaces/irunningbackgroundtaskdata.md): Interface for the data of a running task.
- [ITelegramCache](https://prethink.gitbook.io/prtelegrambot/api/interfaces/itelegramcache.md): Cache for the data.
- [IUserManager](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iusermanager.md): Interface of the user management manager.
- [IWhiteListManager](https://prethink.gitbook.io/prtelegrambot/api/interfaces/iwhitelistmanager.md): Interface of the user white list manager.
- [Enums](https://prethink.gitbook.io/prtelegrambot/api/enums.md): Enumerations used across the public API.
- [ActionWithLastMessage](https://prethink.gitbook.io/prtelegrambot/api/enums/actionwithlastmessage.md): Action to perform on the last message, for inline buttons.
- [CommandComparison](https://prethink.gitbook.io/prtelegrambot/api/enums/commandcomparison.md): Command comparison.
- [CommandType](https://prethink.gitbook.io/prtelegrambot/api/enums/commandtype.md): Command types.
- [ExecuteStepResult](https://prethink.gitbook.io/prtelegrambot/api/enums/executestepresult.md): The result of executing the step.
- [InternalCheckResult](https://prethink.gitbook.io/prtelegrambot/api/enums/internalcheckresult.md): Internal check performed on commands before they run.
- [UpdateResult](https://prethink.gitbook.io/prtelegrambot/api/enums/updateresult.md): The result of handling the update.
- [Extension methods](https://prethink.gitbook.io/prtelegrambot/api/extension-methods.md): Extension methods the framework adds to the context, the update and the bot.
- [AccessExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/accessextension.md): Extension methods for access checks.
- [BotContextExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/botcontextextension.md): Extension methods for the bot context.
- [CacheExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/cacheextension.md): Class for working with temporary data
- [DescriptionExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/descriptionextension.md): Extension methods for descriptions.
- [ITelegramBotClientExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/itelegrambotclientextension.md): Extension methods for ITelegramBotClient.
- [MessageExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/messageextension.md): Extension methods for working with a message
- [PageExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/pageextension.md): Helps split the data into pages.
- [PRBotBaseExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/prbotbaseextension.md): Extension methods for PRBotBase.
- [ServiceProviderExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/serviceproviderextension.md): Extension methods for ServiceProviderExtension.
- [StepExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/stepextension.md): Lets the user execute commands step by step
- [UpdateExtension](https://prethink.gitbook.io/prtelegrambot/api/extension-methods/updateextension.md): Extension methods for Telegram updates.
- [Utils](https://prethink.gitbook.io/prtelegrambot/api/utils.md): Helper classes for menus, access, groups, the calendar and more.
- [AccessUtils](https://prethink.gitbook.io/prtelegrambot/api/utils/accessutils.md): Utilities for working with access rights.
- [BotCollection](https://prethink.gitbook.io/prtelegrambot/api/utils/botcollection.md): Class that holds all bots.
- [BotConfigJsonProvider](https://prethink.gitbook.io/prtelegrambot/api/utils/botconfigjsonprovider.md): Provider that works with json configuration files.
- [CalendarUtils](https://prethink.gitbook.io/prtelegrambot/api/utils/calendarutils.md): Utilities for working with the calendar.
- [Generator](https://prethink.gitbook.io/prtelegrambot/api/utils/generator.md): Generator for various kinds of data.
- [GroupUtils](https://prethink.gitbook.io/prtelegrambot/api/utils/grouputils.md): Utilities for working with groups.
- [MenuGenerator](https://prethink.gitbook.io/prtelegrambot/api/utils/menugenerator.md): Class that makes generating menus convenient.
- [MessageAwaiter](https://prethink.gitbook.io/prtelegrambot/api/utils/messageawaiter.md): Sends a message before processing and deletes it afterwards.
- [Tips and practices](https://prethink.gitbook.io/prtelegrambot/tips.md): Small things that are easy to miss.
- [Working with commands](https://prethink.gitbook.io/prtelegrambot/tips/working-with-commands.md): One method serving every bot, and the flags that control a step sequence.
- [Before and after an update](https://prethink.gitbook.io/prtelegrambot/tips/before-and-after-update.md): Running your own logic before and after every update the bot handles.
- [A command for administrators only](https://prethink.gitbook.io/prtelegrambot/tips/admin-only-command.md): Combining a custom attribute with a pre-execution check to gate commands.
- [Video tutorials](https://prethink.gitbook.io/prtelegrambot/video-tutorials.md): Video walkthroughs, and the project that goes with them.
