Merge pull request #95 from ticketfrei/master

2.1.3 Release
This commit is contained in:
b3yond 2019-05-04 12:15:41 +02:00 committed by GitHub
commit 7712d27d1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -2,7 +2,7 @@
from bot import Bot
import logging
from mastodon import Mastodon
from mastodon import Mastodon, MastodonServerError
import re
from report import Report
@ -25,8 +25,8 @@ class MastodonBot(Bot):
return mentions
try:
notifications = m.notifications()
except Exception:
logger.error("Unknown Mastodon API Error.", exc_info=True)
except MastodonServerError:
logger.error("Unknown Mastodon API Error: 502")
return mentions
for status in notifications:
if (status['type'] == 'mention' and

View file

@ -32,6 +32,12 @@ class TelegramBot(Bot):
logger.error("Unknown Telegram error code: " + str(update))
return reports
user.save_seen_tg(update.update_id)
if update.message.photo:
tb.send_message(
update.message.sender.id,
"Sending Photos is not supported for privacy reasons. Can "
"you describe it as text instead?")
continue
if update.message.text.lower() == "/start":
user.add_telegram_subscribers(update.message.sender.id)
tb.send_message(

View file

@ -73,7 +73,7 @@ class TwitterBot(Bot):
def post(self, user, report):
try:
api = self.get_api(user)
except IndexError:
except TypeError:
return # no twitter account for this user.
try:
if report.source == self: