tgram_dnd.conditions package¶
Submodules¶
tgram_dnd.conditions.base module¶
tgram_dnd.conditions.condition module¶
- class tgram_dnd.conditions.condition.Condition(action: Callable | Action, success: Callable | Action = None, fail: Callable | Action = None, stop: bool = False)[source]¶
Bases:
BaseConditiona 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
- Parameters:
action (Union[
tgram_dnd.actions.action.Action, Callable]) – the main conditionsuccess (Union[
tgram_dnd.actions.action.Action, Callable], optional) – the function/action that will be executed in successful conditionfail (Union[
tgram_dnd.actions.action.Action, Callable], optional) – the function/action that will be executed in failing conditionstop – (bool, False): wether to stop the current block execution or not, defaults to False