[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;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IStartFormSelectionStage MiddlewareMessageLoop(Func<MiddlewareBaseMessageLoop, MiddlewareBaseMessageLoop> messageLoopConfiguration)
|
||||||
|
{
|
||||||
|
_messageLoopFactory = messageLoopConfiguration(new MiddlewareBaseMessageLoop());
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public IStartFormSelectionStage MinimalMessageLoop()
|
public IStartFormSelectionStage MinimalMessageLoop()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
using TelegramBotBase.Interfaces;
|
using System;
|
||||||
|
using TelegramBotBase.Interfaces;
|
||||||
|
using TelegramBotBase.MessageLoops;
|
||||||
|
|
||||||
namespace TelegramBotBase.Builder.Interfaces;
|
namespace TelegramBotBase.Builder.Interfaces;
|
||||||
|
|
||||||
@ -12,6 +14,12 @@ public interface IMessageLoopSelectionStage
|
|||||||
IStartFormSelectionStage DefaultMessageLoop();
|
IStartFormSelectionStage DefaultMessageLoop();
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Choses a fully customizable middleware-based message loop.
|
||||||
|
/// </summary>
|
||||||
|
IStartFormSelectionStage MiddlewareMessageLoop(Func<MiddlewareBaseMessageLoop, MiddlewareBaseMessageLoop> messageLoopConfiguration);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Chooses a minimalistic message loop, which catches all update types and only calls the Load function.
|
/// Chooses a minimalistic message loop, which catches all update types and only calls the Load function.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user