telegram-text integration
This release implements a simple telegram-text integration.
How it works
- telegram-text is now an optional dependency, installation can be done with
pip install origamibot[telegram-text]
for example, or as a separate module of course. - instances of
telegram_text.base.Element
and it's descendants can be passed straight totext
andcaption
parameters of API calls. - Appropriate type hints are in place
- when converting to markup string, takes into account passed
parse_mode
, if not present sets it toHTML
by default. - old-style text messages are unaffected
- if telegram-text is not installed converting function is no-op
Example usage
from origamibot import OrigamiBot
from telegram_text import Bold
token: str = "blahblah"
my_cid: int = 12516745
bot = OrigamiBot(token)
bot.send_message(my_cid, Bold("Bold text message"))