@@ -287,23 +287,21 @@ def language_cmd(bot, update):
287287 reply_markup = lang_keyboard , message_id = update .message .message_id )
288288
289289
290- def comment_cmd (bot , update ):
290+ def comment_cmd (bot , update , args ):
291291 user_id = update .message .from_user .id
292292 chat_id = update .message .chat_id
293293 first_name = update .message .from_user .first_name
294294 last_name = update .message .from_user .last_name
295295 username = update .message .from_user .username
296296 db = DBwrapper .get_instance ()
297297 lang_id = db .get_lang_id (user_id )
298- text = update .message .text
299- params = text .split ()
300298
301299 state_handler = StateHandler .get_instance ()
302300 user = state_handler .get_user (user_id )
303301
304302 if user .get_state () == UserState .IDLE :
305- if len (params ) > 1 :
306- text = " " .join (params [ 1 :] )
303+ if len (args ) > 1 :
304+ text = " " .join (args )
307305 logger .debug ("New comment! {}!" .format (user_id ))
308306
309307 bot .sendMessage (chat_id = chat_id , text = translate ("userComment" , lang_id ))
@@ -444,7 +442,7 @@ def restart(bot, update):
444442hide_handler = CommandHandler ('hide' , hide_cmd )
445443stats_handler = CommandHandler ('stats' , stats_cmd )
446444language_handler = CommandHandler ('language' , language_cmd )
447- comment_handler = CommandHandler ('comment' , comment_cmd )
445+ comment_handler = CommandHandler ('comment' , comment_cmd , pass_args = True )
448446callback_handler = CallbackQueryHandler (callback_eval )
449447users_handler = CommandHandler ('users' , users )
450448answer_handler = CommandHandler ('answer' , answer )
0 commit comments