![]() DEFAULT_TYPE ) -> None : 60 """Echo the user message.""" 61 await update. reply_text ( "Help!" ) 57 58 59 async def echo ( update : Update, context : ContextTypes. DEFAULT_TYPE ) -> None : 55 """Send a message when the command /help is issued.""" 56 await update. reply_html ( 49 rf "Hi !", 50 reply_markup = ForceReply ( selective = True ), 51 ) 52 53 54 async def help_command ( update : Update, context : ContextTypes. 16 """ 17 18 import logging 19 20 from telegram import _version_ as TG_VER 21 22 try : 23 from telegram import _version_info_ 24 except ImportError : 25 _version_info_ = ( 0, 0, 0, 0, 0 ) # type: ignore 26 27 if _version_info_ None : 46 """Send a message when the command /start is issued.""" 47 user = update. ![]() ![]() 14 Press Ctrl-C on the command line or send a signal to the process to stop the 15 bot. 11 12 Usage: 13 Basic Echobot example, repeats messages. 10 Then, the bot is started and runs until we press Ctrl-C on the command line. Then, those functions are passed to 9 the Application and registered at their respective places. 7 8 First, a few handler functions are defined. 4 5 """ 6 Simple Bot to reply to Telegram messages. 1 #!/usr/bin/env python 2 # pylint: disable=unused-argument, wrong-import-position 3 # This program is dedicated to the public domain under the CC0 license.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |