tgram_dnd.blocks package

Submodules

tgram_dnd.blocks.callback_block module

class tgram_dnd.blocks.callback_block.CallbackBlock(actions: List[Action] | Action | None, filter: Filter | None = None)[source]

Bases: object

the block that process Callbacks and runs a series of Actions (What Is An Action?)

Parameters:
  • actions (Union[List[tgram_dnd.actions.Action], tgram_dnd.actions.Action]) – the actions that will be executed

  • filter (tgram.filters.Filter, optional) – filter incoming callbacks, pass Nothing to trigger all updates

async exec(bot: TgBot, cb: CallbackQuery)[source]

this is where the block actions run

inject(app: App)[source]

tgram_dnd.blocks.message_block module

class tgram_dnd.blocks.message_block.MessageBlock(actions: List[Action] | Action | None, filter: Filter | None = None)[source]

Bases: object

the block that process Messages and runs a series of Actions (What Is An Action?)

Parameters:
  • actions (Union[List[tgram_dnd.actions.Action], tgram_dnd.actions.Action]) – the actions that will be executed

  • filter – filter incoming callbacks, pass Nothing to trigger all updates

async exec(bot: TgBot, m: Message)[source]

this is where the block actions run

inject(app: App)[source]

Module contents