def pub_received(self, bot, update):
rospy.loginfo("Received: " + str(update))
valid_necessary_words = ['what do you see',
'picture',
'camera']
found_word = False
for v in valid_necessary_words:
if v in update.message.text.lower():
img_file_path = self.get_image()
update.message.reply_photo(photo=open(img_file_path, 'rb'),
caption="This is what I see!")
found_word = True
break
if not found_word:
update.message.reply_text("Try any of: " +
str(valid_necessary_words))
评论列表
文章目录