def chooseLanguage(bot, update, chat_data, args):
TRACKING.total.post()
if not checkValidCommand(update.message.text, bot.username):
return
logger.info("Choose language received")
if args:
for key in LANGUAGES:
for lang in LANGUAGES[key]:
if lang[0] == args[0]:
reply_text = 'Set language to: %s' % args[0]
update.message.reply_text(reply_text)
chat_data['lang'] = args[0]
return
chat_data['choosing'] = True
logger.debug("Starting choose language inline mess")
reply_text = "Please choose your language, or the closest.\n"
if not 'lang' in chat_data:
reply_text += "Current language selected: en-US"
chat_data['lang'] = 'en-US'
chat_data['langlist'] = sorted(LANGUAGES.keys())
keyboard = InlineKeyboardMarkup(updateKeyboard(chat_data))
update.message.reply_text(reply_text, reply_markup=keyboard, quote=False)
评论列表
文章目录