tgram_dnd.actions.api.methods package¶
Submodules¶
tgram_dnd.actions.api.methods.check_subscription module¶
- class tgram_dnd.actions.api.methods.check_subscription.Subscribed(kwgs: SubscribedKwargs, middleware=None, fill_vars=True, allow_restricted: bool = True, default_value: bool = False)[source]¶
Bases:
Actionthis Action is used to check wether a user is a member in the specified channel/chat
from tgram_dnd import ..., Subscribed, Reply, Condition Condition( action=Subscribed({ "chat_id": CHAT_ID, "user_id": "{{from.id}}" }), success=Reply("text", {"text": "You are Subscribed"}), fail=Reply("text", {"text": "You are NOT Subscribed please subscribe @YourChat"}) )
- Parameters:
kwgs – (
tgram_dnd.actions.api.methods.check_subscription.SubscribedKwargs): the check argumentsmiddleware (Callable, optional) – a function to be executed before the main function run
fill_vars (bool, True) – Wether to automatically render vars in kwgs or not, defaults to true
allow_resticted (bool, True) – wether to count RestrictedChatMember as an allowed condition or not
default_value (bool, False) – the default boolean value returned when an Exception occurs during the check process, defaults to False (Operation Failed)
tgram_dnd.actions.api.methods.reply module¶
- class tgram_dnd.actions.api.methods.reply.Reply(func_name: tgram_dnd.enums.reply_methods.REPLY_METHODS, kwgs: ReplyInput = {}, middleware: Callable = None, fill_vars: bool = True)[source]¶
Bases:
Actionan abstract method to Reply to update
- Parameters:
func_name (
tgram_dnd.enums.reply_methods.REPLY_METHODS) – The wanted function to reply with, example; “photo” will use reply_photokwgs (
tgram_dnd.enums.reply_input.ReplyInput, optional) – arguments for replymiddleware (Callable, optional) – middleware
fill_vars (bool, True) – Weither to automatically render vars in kwgs or not, defaults to true