[FEATURE] Add MiddlewareMessageLoop to BotBaseBuilder
This commit is contained in:
parent
52bedd29e3
commit
365845f832
@ -137,6 +137,12 @@ public class BotBaseBuilder : IAPIKeySelectionStage, IMessageLoopSelectionStage,
|
||||
return this;
|
||||
}
|
||||
|
||||
public IStartFormSelectionStage MiddlewareMessageLoop(Func<MiddlewareBaseMessageLoop, MiddlewareBaseMessageLoop> messageLoopConfiguration)
|
||||
{
|
||||
_messageLoopFactory = messageLoopConfiguration(new MiddlewareBaseMessageLoop());
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public IStartFormSelectionStage MinimalMessageLoop()
|
||||
{
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
using TelegramBotBase.Interfaces;
|
||||
using System;
|
||||
using TelegramBotBase.Interfaces;
|
||||
using TelegramBotBase.MessageLoops;
|
||||
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
@ -12,6 +14,12 @@ public interface IMessageLoopSelectionStage
|
||||
IStartFormSelectionStage DefaultMessageLoop();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Choses a fully customizable middleware-based message loop.
|
||||
/// </summary>
|
||||
IStartFormSelectionStage MiddlewareMessageLoop(Func<MiddlewareBaseMessageLoop, MiddlewareBaseMessageLoop> messageLoopConfiguration);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a minimalistic message loop, which catches all update types and only calls the Load function.
|
||||
/// </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user