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: |

On Tuesday, some local media outlets included Sing Tao Daily cited sources as saying the Hong Kong government was considering restricting access to Telegram. Privacy Commissioner for Personal Data Ada Chung told to the Legislative Council on Monday that government officials, police and lawmakers remain the targets of “doxxing” despite a privacy law amendment last year that criminalised the malicious disclosure of personal information. With the administration mulling over limiting access to doxxing groups, a prominent Telegram doxxing group apparently went on a "revenge spree." 6How to manage your Telegram channel? Hashtags are a fast way to find the correct information on social media. To put your content out there, be sure to add hashtags to each post. We have two intelligent tips to give you: A Telegram channel is used for various purposes, from sharing helpful content to implementing a business strategy. In addition, you can use your channel to build and improve your company image, boost your sales, make profits, enhance customer loyalty, and more.
from us


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