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

Telegram channels fall into two types: Over 33,000 people sent out over 1,000 doxxing messages in the group. Although the administrators tried to delete all of the messages, the posting speed was far too much for them to keep up. A few years ago, you had to use a special bot to run a poll on Telegram. Now you can easily do that yourself in two clicks. Hit the Menu icon and select “Create Poll.” Write your question and add up to 10 options. Running polls is a powerful strategy for getting feedback from your audience. If you’re considering the possibility of modifying your channel in any way, be sure to ask your subscribers’ opinions first. With the “Bear Market Screaming Therapy Group,” we’ve now transcended language. Co-founder of NFT renting protocol Rentable World emiliano.eth shared the group Tuesday morning on Twitter, calling out the "degenerate" community, or crypto obsessives that engage in high-risk trading.
from us


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