GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.python-telegram-bot.org — Examples - python-telegram-bot v22.8 Examples¶In this section we display small examples to show what a bot written with
All examples are licensed under the CC0 License and are therefore fully dedicated to the public domain. You can use them as the base for your own bots without worrying about copyrights. Do note that we ignore one pythonic convention. Best practice would
dictate, in many handler callbacks function signatures, to replace the
argument echobot.py¶This is probably the base for most of the bots made with
timerbot.py¶This bot uses the
conversationbot.py¶A common task for a bot is to ask information from the user. In v5.0 of
this library, we introduced the
conversationbot2.py¶A more complex example of a bot that uses the nestedconversationbot.py¶An even more complex example of a bot that uses the nested
persistentconversationbot.py¶A basic example of a bot store conversation state and user_data over multiple restarts. inlinekeyboard.py¶This example sheds some light on inline keyboards, callback queries and message editing. A wiki site explaining this examples lives here. inlinekeyboard2.py¶A more complex example about inline keyboards, callback queries and message editing. This example showcases how an interactive menu could be build using inline keyboards. deeplinking.py¶A basic example on how to use deeplinking with inline keyboards. inlinebot.py¶A basic example of an inline bot. Don’t forget to enable inline mode with @BotFather. pollbot.py¶This example sheds some light on polls, poll answers and the corresponding handlers. passportbot.py¶A basic example of a bot that can accept passports. Use in combination
with the HTML page.
Don’t forget to enable and configure payments with
@BotFather. Check out this
guide
on Telegram passports in PTB.
Note: To use Telegram Passport, you must install PTB via paymentbot.py¶A basic example of a bot that can accept payments. Don’t forget to enable and configure payments with @BotFather. errorhandlerbot.py¶A basic example on how to set up a custom error handler. chatmemberbot.py¶A basic example on how webappbot.py¶A basic example of how Telegram WebApps can be used. Use in combination with the HTML page. For your convenience, this file is hosted by the PTB team such that you don’t need to host it yourself. Uses the iro.js JavaScript library to showcase a user interface that is hard to achieve with native Telegram functionality. contexttypesbot.py¶This example showcases how customwebhookbot.py¶This example showcases how a custom webhook setup can be used in
combination with arbitrarycallbackdatabot.py¶This example showcases how PTBs “arbitrary callback data” feature can be
used.
Note: To use arbitrary callback data, you must install PTB via Pure API¶The rawapibot.py example example uses only the pure, “bare-metal” API wrapper. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |