pyrubrum Logo
latest

Quickstart

  • Installation
  • Writing your first bot

Examples

  • Environment variables
  • CafΓ© Bot
  • Calendar Bot
  • Hitchhiker Bot
  • Sample Bot

API Reference

  • Database
  • Database Errors
  • Handlers
  • Keyboard
  • Menus
  • Objects
  • Styles
    • BaseStyle
    • MenuStyle
    • PageStyle
  • Tree
  • Types

Meta

  • Assets
  • Changelog
  • Code of Conduct
  • Contributing
  • Flowchart guidelines
  • Glossary
  • License
  • Read me
  • Security Policy
pyrubrum
  • Docs »
  • Styles »
  • MenuStyle
  • Edit on GitHub

MenuStyleΒΆ

class pyrubrum.MenuStyle(back_text: Optional[str] = 'πŸ”™', limit: Optional[int] = 2)ΒΆ

Provide a standard keyboard with which you can refer to children and parent menus effortlessly.

Parameters
  • back_text (Optional[str]) – The text which will be displayed inside the button that lets the user go back to the parent menu. Defaults to β€œπŸ”™β€.

  • limit (Optional[int]) – The limit of buttons per row. Defaults to 2.

generate(handler: Handler, client: pyrogram.client.client.Client, context: Any, parameters: Dict[str, Any], menu: Menu) → List[List[Button]]ΒΆ

Provide a keyboard, filled with all the buttons which refer to the children menus and a special button for linking the user to the parent menu, if any.

Parameters
  • handler (BaseHandler) – The handler which coordinates the management of the menus.

  • client (Client) – The client which is linked to the handler.

  • context (Union[CallbackQuery, Message]) – The context for which the button is generated.

  • parameters (Dict[str, Any]) – The parameters which were passed to the handler.

  • menu (Menu) – The menu the keyboard is being built for.

Returns

The generated inline keyboard, which is then displayed to the user.

Return type

pyrogram.InlineKeyboardMarkup

Next Previous

© Copyright 2020, Hearot Revision 2539f70e.

Built with Sphinx using a theme provided by Read the Docs.