[docs]classCondition(BaseCondition):'''a condition in its name, is a condition this is a basic condition just like if-else which takes `action` as the main condition and it executes the `success` function if `action` turned out to be True else it will execute the `fail` function Args: action (Union[:class:`tgram_dnd.actions.action.Action`, Callable]): the main condition success (Union[:class:`tgram_dnd.actions.action.Action`, Callable], *optional*): the function/action that will be executed in successful condition fail (Union[:class:`tgram_dnd.actions.action.Action`, Callable], *optional*): the function/action that will be executed in failing condition stop: (bool, *False*): wether to stop the current block execution or not, defaults to False'''def__init__(self,action:Union[Callable,Action],success:Union[Callable,Action]=None,fail:Union[Callable,Action]=None,stop:bool=False):self.condition=actionself.success=successself.fail=failself.stop=stopasyncdef__call__(self,u:Update):# inject appforobjin[self.condition,self.success,self.fail]:ifisinstance(obj,Action):obj.inject(self.app)# run conditionsifawaitrun_function(self.condition,u):ifself.success:awaitrun_function(self.success,u)returnifself.fail:awaitrun_function(self.fail,u)ifself.stop:raiseStopBlock