Merge v2.0.28 into v2-newsletters

This commit is contained in:
JonnyWong16 2018-04-02 14:33:52 -07:00
commit 5ef8947532
20 changed files with 171 additions and 67 deletions

View file

@ -3321,10 +3321,17 @@ class TELEGRAM(Notifier):
if poster_content:
poster_filename = 'poster_{}.png'.format(pretty_metadata.parameters['rating_key'])
files = {'photo': (poster_filename, poster_content, 'image/png')}
data['caption'] = text
return self.make_request('https://api.telegram.org/bot{}/sendPhoto'.format(self.config['bot_token']),
data=data, files=files)
if len(text) > 200:
data['disable_notification'] = True
else:
data['caption'] = text
r = self.make_request('https://api.telegram.org/bot{}/sendPhoto'.format(self.config['bot_token']),
data=data, files=files)
if not data.pop('disable_notification', None):
return r
data['text'] = text