Metadata-Version: 2.0
Name: baymax
Version: 0.0.4
Summary: A simple telegram bot framework on top of Python asyncio
Home-page: https://github.com/dmrz/baymax
Author: Dima Moroz
Author-email: me@dimamoroz.com
License: MIT
Keywords: telegram bot asyncio
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=3.6
Requires-Dist: aiodns (==1.1.1)
Requires-Dist: aiohttp (==2.3.9)
Requires-Dist: async-timeout (==2.0.0)
Requires-Dist: colorlog (==3.1.0)
Requires-Dist: uvloop (==0.9.1)

Baymax, a simple telegram bot framework on top of Python asyncio
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Work in progress

Requirements
~~~~~~~~~~~~

-  Python 3.6 or higher

Installation
~~~~~~~~~~~~

.. code:: bash

    pip install baymax

Basic usage example
~~~~~~~~~~~~~~~~~~~

.. code:: python

    from baymax.bot import Bot

    bot = Bot('token')

    @bot.on('/start')
    async def start_handler(message):
        await bot.reply(message, 'Welcome!')

    bot.run()

Middleware example
~~~~~~~~~~~~~~~~~~

.. code:: python

    @bot.middleware
    async def message_logging_middleware(raw_update):
        bot.logger.info('New update received: %s', raw_update['update_id'])

..

    NOTE: All middleware functions should be coroutines for now, even if
    they do not have asynchronous actions.

Reply keyboard markup example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

    from baymax.markups import KeyboardButton, ReplyKeyboardMarkup

    @bot.on('/rate')
    async def rate_handler(message):
        await bot.reply(message, 'Rate me', reply_markup=ReplyKeyboardMarkup(
            [
                [
                    KeyboardButton('⭐️'),
                    KeyboardButton('⭐️⭐️'),
                    KeyboardButton('⭐️⭐️⭐️')
                ]
            ], resize_keyboard=True, one_time_keyboard=True))

..

    NOTE: Reply markup API / objects will be changing, they are far from
    good now.


