From 6b638f2221ebeb645b141e3053a0fa7a41b205c1 Mon Sep 17 00:00:00 2001 From: Ceda EI Date: Mon, 22 Oct 2018 15:31:49 +0530 Subject: [PATCH] Complete /start --- bot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 7313ca4..2f6c461 100644 --- a/bot.py +++ b/bot.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import logging +import telegram from telegram.ext import Updater, CommandHandler try: @@ -15,10 +16,17 @@ logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - \ def start(bot, update): chat_id = update.message.chat_id - name = update.message.message + name = str(update.message.from_user.first_name) + if update.message.from_user.last_name: + name += " " + str(update.message.from_user.last_name) text = f"Hello {name}!\n" + \ "Welcome to Questable. To get started, check /help." - bot.send_message(chat_id=chat_id, text=text) + custom_keyboard = [ + ['Add Quest', 'Add Side-quests'], + ['List Quests', 'List Side-quests'] + ] + reply_markup = telegram.ReplyKeyboardMarkup(custom_keyboard) + bot.send_message(chat_id=chat_id, text=text, reply_markup=reply_markup) updater = Updater(token=config.api_key)