Merge pull request #101 from SchoolGuy/fix-non-text-message-crash

Fix non text message crash
This commit is contained in:
b3yond 2019-07-22 21:05:37 +02:00 committed by GitHub
commit b2acc15400

View file

@ -38,6 +38,12 @@ class TelegramBot(Bot):
"Sending Photos is not supported for privacy reasons. Can " "Sending Photos is not supported for privacy reasons. Can "
"you describe it as text instead?") "you describe it as text instead?")
continue continue
if hasattr(update.message, 'text'):
tb.send_message(
update.message.sender.id,
"We only support text only reporting for privacy reasons."
"Can you describe it as text instead?")
continue
if update.message.text.lower() == "/start": if update.message.text.lower() == "/start":
user.add_telegram_subscribers(update.message.sender.id) user.add_telegram_subscribers(update.message.sender.id)
tb.send_message( tb.send_message(