@@ -46,7 +46,7 @@ def start(bot, update):
4646
4747def gender (bot , update ):
4848 user = update .message .from_user
49- logger .info ("Gender of %s: %s" % ( user .first_name , update .message .text ) )
49+ logger .info ("Gender of %s: %s" , user .first_name , update .message .text )
5050 update .message .reply_text ('I see! Please send me a photo of yourself, '
5151 'so I know what you look like, or send /skip if you don\' t want to.' ,
5252 reply_markup = ReplyKeyboardRemove ())
@@ -58,7 +58,7 @@ def photo(bot, update):
5858 user = update .message .from_user
5959 photo_file = bot .get_file (update .message .photo [- 1 ].file_id )
6060 photo_file .download ('user_photo.jpg' )
61- logger .info ("Photo of %s: %s" % ( user .first_name , 'user_photo.jpg' ) )
61+ logger .info ("Photo of %s: %s" , user .first_name , 'user_photo.jpg' )
6262 update .message .reply_text ('Gorgeous! Now, send me your location please, '
6363 'or send /skip if you don\' t want to.' )
6464
@@ -67,7 +67,7 @@ def photo(bot, update):
6767
6868def skip_photo (bot , update ):
6969 user = update .message .from_user
70- logger .info ("User %s did not send a photo." % user .first_name )
70+ logger .info ("User %s did not send a photo." , user .first_name )
7171 update .message .reply_text ('I bet you look great! Now, send me your location please, '
7272 'or send /skip.' )
7373
@@ -77,8 +77,8 @@ def skip_photo(bot, update):
7777def location (bot , update ):
7878 user = update .message .from_user
7979 user_location = update .message .location
80- logger .info ("Location of %s: %f / %f"
81- % ( user . first_name , user_location .latitude , user_location . longitude ) )
80+ logger .info ("Location of %s: %f / %f" , user . first_name , user_location . latitude ,
81+ user_location .longitude )
8282 update .message .reply_text ('Maybe I can visit you sometime! '
8383 'At last, tell me something about yourself.' )
8484
@@ -87,7 +87,7 @@ def location(bot, update):
8787
8888def skip_location (bot , update ):
8989 user = update .message .from_user
90- logger .info ("User %s did not send a location." % user .first_name )
90+ logger .info ("User %s did not send a location." , user .first_name )
9191 update .message .reply_text ('You seem a bit paranoid! '
9292 'At last, tell me something about yourself.' )
9393
@@ -96,23 +96,24 @@ def skip_location(bot, update):
9696
9797def bio (bot , update ):
9898 user = update .message .from_user
99- logger .info ("Bio of %s: %s" % ( user .first_name , update .message .text ) )
99+ logger .info ("Bio of %s: %s" , user .first_name , update .message .text )
100100 update .message .reply_text ('Thank you! I hope we can talk again some day.' )
101101
102102 return ConversationHandler .END
103103
104104
105105def cancel (bot , update ):
106106 user = update .message .from_user
107- logger .info ("User %s canceled the conversation." % user .first_name )
107+ logger .info ("User %s canceled the conversation." , user .first_name )
108108 update .message .reply_text ('Bye! I hope we can talk again some day.' ,
109109 reply_markup = ReplyKeyboardRemove ())
110110
111111 return ConversationHandler .END
112112
113113
114114def error (bot , update , error ):
115- logger .warn ('Update "%s" caused error "%s"' % (update , error ))
115+ """Log Errors caused by Updates."""
116+ logger .warning ('Update "%s" caused error "%s"' , update , error )
116117
117118
118119def main ():
0 commit comments