1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-04 07:39:39 +00:00

add filtering out of other bots commands by default

This commit is contained in:
2025-08-10 18:24:34 +06:00
parent c09d089707
commit 0fd8c1e2f3
2 changed files with 145 additions and 49 deletions

View File

@@ -1152,42 +1152,42 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingKt {
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job; public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job; public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job; public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
} }
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandledKt { public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandledKt {

View File

@@ -5,6 +5,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.*
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilterExcludeMediaGroups import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilterExcludeMediaGroups
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.botInfo
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
@@ -15,6 +16,7 @@ import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithNamedArgs
import dev.inmo.tgbotapi.types.BotCommand import dev.inmo.tgbotapi.types.BotCommand
import dev.inmo.tgbotapi.types.message.content.TextContent import dev.inmo.tgbotapi.types.message.content.TextContent
import dev.inmo.tgbotapi.types.message.content.TextMessage import dev.inmo.tgbotapi.types.message.content.TextMessage
import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource
import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.types.update.abstracts.Update
import dev.inmo.tgbotapi.utils.launchWithBotLogger import dev.inmo.tgbotapi.utils.launchWithBotLogger
import kotlinx.coroutines.Job import kotlinx.coroutines.Job
@@ -27,6 +29,7 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onText( ): Job = onText(
CommonMessageFilter<TextContent> { message -> CommonMessageFilter<TextContent> { message ->
@@ -40,6 +43,23 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
sizeRequirement && textSources.any { sizeRequirement && textSources.any {
commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false) commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false)
} }
}.let {
if (excludeCommandsToOtherBots) {
it * lambda@{
it.content.textSources.forEach {
val command = it.botCommandTextSourceOrNull() ?.takeIf {
commandRegex.matches(it.command)
} ?: return@forEach
val botInfo = botInfo()
if (botInfo == null || command.username == botInfo.username) {
return@lambda true
}
}
false
}
} else {
it
}
}.let { }.let {
initialFilter ?.times(it) ?: it initialFilter ?.times(it) ?: it
}, },
@@ -56,17 +76,19 @@ fun <BC : BehaviourContext> BC.command(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = launchInNewSubContext { ): Job = launchInNewSubContext {
runCatching { runCatching {
this@launchInNewSubContext.commandUncounted( this@launchInNewSubContext.commandUncounted(
commandRegex, commandRegex = commandRegex,
requireOnlyCommandInMessage, requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter, initialFilter = initialFilter,
subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory, markerFactory = markerFactory,
additionalSubcontextInitialAction, additionalSubcontextInitialAction = additionalSubcontextInitialAction,
scenarioReceiver excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
) )
}.onFailure { }.onFailure {
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex) triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
@@ -94,8 +116,18 @@ fun <BC : BehaviourContext> BC.command(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = command(
commandRegex = command.toRegex(),
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -109,8 +141,18 @@ fun <BC : BehaviourContext> BC.command(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ) = command(
command = botCommand.command,
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -124,8 +166,18 @@ fun <BC : BehaviourContext> BC.onCommand(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ): Job = command(
commandRegex = commandRegex,
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -139,8 +191,18 @@ fun <BC : BehaviourContext> BC.onCommand(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ): Job = onCommand(
commandRegex = command.toRegex(),
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -154,8 +216,18 @@ fun <BC : BehaviourContext> BC.onCommand(
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage> scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver) ): Job = onCommand(
command = botCommand.command,
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory,
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver
)
/** /**
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
@@ -169,13 +241,15 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = command( ) = command(
commandRegex, commandRegex,
requireOnlyCommandInMessage = false, requireOnlyCommandInMessage = false,
initialFilter = initialFilter, initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory markerFactory = markerFactory,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
) { ) {
val args = it.parseCommandsWithArgs(argsSeparator = argsSeparator).let { commandsWithArgs -> val args = it.parseCommandsWithArgs(argsSeparator = argsSeparator).let { commandsWithArgs ->
val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null
@@ -196,6 +270,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = commandWithArgs( ) = commandWithArgs(
command.toRegex(), command.toRegex(),
@@ -203,6 +278,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -218,6 +294,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
) = commandWithArgs( ) = commandWithArgs(
botCommand.command, botCommand.command,
@@ -225,6 +302,7 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -241,12 +319,14 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = command( ) = command(
commandRegex, commandRegex,
requireOnlyCommandInMessage = false, requireOnlyCommandInMessage = false,
initialFilter = initialFilter, initialFilter = initialFilter,
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
markerFactory = markerFactory markerFactory = markerFactory
) { ) {
val args = it.parseCommandsWithNamedArgs(argsSeparator = argsSeparator, nameArgSeparator = nameArgSeparator).let { commandsWithArgs -> val args = it.parseCommandsWithNamedArgs(argsSeparator = argsSeparator, nameArgSeparator = nameArgSeparator).let { commandsWithArgs ->
@@ -269,6 +349,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = commandWithNamedArgs( ) = commandWithNamedArgs(
command.toRegex(), command.toRegex(),
@@ -277,6 +358,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -293,6 +375,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = commandWithNamedArgs( ) = commandWithNamedArgs(
botCommand.command, botCommand.command,
@@ -301,6 +384,7 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -316,6 +400,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = commandWithArgs( ): Job = commandWithArgs(
commandRegex = commandRegex, commandRegex = commandRegex,
@@ -323,6 +408,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -338,6 +424,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = onCommandWithArgs( ): Job = onCommandWithArgs(
commandRegex = command.toRegex(), commandRegex = command.toRegex(),
@@ -345,6 +432,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -360,6 +448,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory, markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
): Job = onCommandWithArgs( ): Job = onCommandWithArgs(
command = botCommand.command, command = botCommand.command,
@@ -367,6 +456,7 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
subcontextUpdatesFilter = subcontextUpdatesFilter, subcontextUpdatesFilter = subcontextUpdatesFilter,
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -383,6 +473,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = commandWithNamedArgs( ) = commandWithNamedArgs(
commandRegex, commandRegex,
@@ -391,6 +482,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver, scenarioReceiver = scenarioReceiver,
) )
@@ -407,6 +499,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = onCommandWithNamedArgs( ) = onCommandWithNamedArgs(
command.toRegex(), command.toRegex(),
@@ -415,6 +508,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )
@@ -431,6 +525,7 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null, additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
excludeCommandsToOtherBots: Boolean = true,
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>> scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
) = onCommandWithNamedArgs( ) = onCommandWithNamedArgs(
botCommand.command, botCommand.command,
@@ -439,5 +534,6 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
markerFactory = markerFactory, markerFactory = markerFactory,
argsSeparator = argsSeparator, argsSeparator = argsSeparator,
nameArgSeparator = nameArgSeparator, nameArgSeparator = nameArgSeparator,
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
scenarioReceiver = scenarioReceiver scenarioReceiver = scenarioReceiver
) )