Merge v2.0.28 into v2-newsletters
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user