Пример #1
0
def handle_message(update, context):
    text = str(update.message.text).lower()
    if (text == "send location"):
        await context.sendVenue({location: {latitude:9.940739, longitude:78.131510}, title: 'CLOUDFLOOR',address: '3B,NMR Subburaman Road, Chinna Chokikulam, Tamil Nadu 625002'});
    else:
        response = r.sample_responses(text)
        update.message.reply_text(response)
Пример #2
0
def handle_message(update, context):
    text = str(update.message.text).lower()
    user = update.effective_user
    print(f'{user["username"]}: {text}')
    response = R.sample_responses(text)
    print(f'Bot: {response}')
    update.message.reply_text(response)
Пример #3
0
def handle_message(update, context):
    text = str(update.message.text).lower()
    if (update.message.chat.type != "supergroup"
            and update.message.chat.type != "group"):
        chatid = update.message.chat_id
        message = update.message
        response = R.sample_responses(bot, text, chatid)
        update.message.reply_text(response)
    elif ("olga" in text):
        update.message.reply_text("I've been mentioned!")
Пример #4
0
def handle_message(update, context):
    text = str(update.message.text).lower()
    
    response = R.sample_responses(text)
    if isinstance(response, list):
        for i in response:
            if i == response[-1]:
                bot.send_message(update.message.chat.id, i + '\nBook your vaccination now at : https://www.cowin.gov.in/home')
            else:
                bot.send_chat_action(chat_id = update.message.chat.id, action= telegram.ChatAction.TYPING)
                bot.send_message(update.message.chat.id, i)
    else:
        bot.send_chat_action(chat_id = update.message.chat.id, action= telegram.ChatAction.TYPING)
        update.message.reply_text(response)
Пример #5
0
def handle_message(update, context):
    text = str(update.message.text).lower()
    response = r.sample_responses(text)

    update.message.reply_text(response)
Пример #6
0
def handle_message(update, context):
    txt = str(update.message.text).lower()
    logger.info(txt)
    response = responses.sample_responses(txt)
    logger.info(response)
    update.message.reply_text(response)