PYTHON_WITH_MOHAMMAD Telegram 103
مرحله ۴: دریافت نام شهر از کاربر
حالا می‌خوایم باتمون بتونه نام شهر رو از کاربر دریافت کنه. برای این کار از MessageHandler استفاده می‌کنیم.

from telegram.ext import MessageHandler, Filters

def get_city(update: Update, context: CallbackContext):
city = update.message.text
update.message.reply_text(f'شهر شما: {city}. در حال دریافت اطلاعات آب‌وهوا...')
# در مرحله بعدی، اطلاعات آب‌وهوا رو دریافت می‌کنیم

dispatcher.add_handler(MessageHandler(Filters.text & ~Filters.command, get_city))



tgoop.com/python_with_mohammad/103
Create:
Last Update:

مرحله ۴: دریافت نام شهر از کاربر
حالا می‌خوایم باتمون بتونه نام شهر رو از کاربر دریافت کنه. برای این کار از MessageHandler استفاده می‌کنیم.


from telegram.ext import MessageHandler, Filters

def get_city(update: Update, context: CallbackContext):
city = update.message.text
update.message.reply_text(f'شهر شما: {city}. در حال دریافت اطلاعات آب‌وهوا...')
# در مرحله بعدی، اطلاعات آب‌وهوا رو دریافت می‌کنیم

dispatcher.add_handler(MessageHandler(Filters.text & ~Filters.command, get_city))

BY آموزش پایتون و برنامه نویسی


Share with your friend now:
tgoop.com/python_with_mohammad/103

View MORE
Open in Telegram


Telegram News

Date: |

Those being doxxed include outgoing Chief Executive Carrie Lam Cheng Yuet-ngor, Chung and police assistant commissioner Joe Chan Tung, who heads police's cyber security and technology crime bureau. Among the requests, the Brazilian electoral Court wanted to know if they could obtain data on the origins of malicious content posted on the platform. According to the TSE, this would enable the authorities to track false content and identify the user responsible for publishing it in the first place. The administrator of a telegram group, "Suck Channel," was sentenced to six years and six months in prison for seven counts of incitement yesterday. As five out of seven counts were serious, Hui sentenced Ng to six years and six months in jail. A Hong Kong protester with a petrol bomb. File photo: Dylan Hollingsworth/HKFP.
from us


Telegram آموزش پایتون و برنامه نویسی
FROM American