Beispiel #1
0
def talk_to_me(bot, update, user_data):
    smile = get_user_smile(user_data)
    user_text = 'Hello {}! You wrote: {}. {}'.format(
        update.message.chat.first_name, update.message.text,
        user_data['smile'])
    logging.info('User: {}, Chat id: {}, Message: {}'.format(
        update.message.chat.username, update.message.chat.id,
        update.message.text))
    update.message.reply_text(user_text, reply_markup=get_keyboard())
Beispiel #2
0
def about_planet(bot, update, user_data):
    smile = get_user_smile(user_data)
    plnt = update.message.text
    plnt_name = plnt.split()[1]
    constellation = get_constellation_by_planet(plnt_name)
    print(constellation)
    update.message.reply_text(
        f"Планета {plnt_name} находится в созвездии {constellation} {smile}",
        reply_markup=get_keyboard())
Beispiel #3
0
def greet_user(bot, update, user_data):
    smile = get_user_smile(user_data)
    user_data['smile'] = smile
    text = 'Hello, {}! With the help of this bot, you can find out ' \
        'in which constellation the planet is today. ' \
        'Just type the command: /planet <planet name>. ' \
        'Something like this: /planet Mars. ' \
        'The list of planets are: Mars, Neptune, Pluto, Saturn, ' \
        'Uranus, Venus, Jupiter. '\
        'Bot can also show what you wrote. ' \
        'Type /cat to see some cats {}' \
        .format(update.message.chat.first_name, smile)

    logging.info(text)
    update.message.reply_text(text, reply_markup=get_keyboard())
Beispiel #4
0
def get_location(bot, update, user_data):
    print(update.message.location)
    update.message.reply_text('Done! {}'.format(get_user_smile(user_data)),
                              reply_markup=get_keyboard())
Beispiel #5
0
def get_contact(bot, update, user_data):
    print(update.message.contact)
    update.message.reply_text('Done! {}'.format(get_user_smile(user_data)),
                              reply_markup=get_keyboard())
Beispiel #6
0
def change_avatar(bot, update, user_data):
    if 'smile' in user_data:
        del user_data['smile']
    smile = get_user_smile(user_data)
    update.message.reply_text('Done! {}'.format(smile),
                              reply_markup=get_keyboard())
Beispiel #7
0
def change_avatar(bot, update, user_data):
    if 'smile' in user_data:
        del user_data['smile']
    smile = get_user_smile(user_data)
    update.message.reply_text(f'Готово: {smile}')
Beispiel #8
0
def talk_to_me(bot, update, user_data):
    smile = get_user_smile(user_data)
    user_text = f"Вы ввели {update.message.text} {smile}"
    print(user_text)
    update.message.reply_text(user_text, reply_markup=get_keyboard())
Beispiel #9
0
def greet_user(bot, update, user_data):
    smile = get_user_smile(user_data)
    text = f"Привет {smile}"
    update.message.reply_text(text, reply_markup=get_keyboard())