mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-08 06:00:51 -07:00
Don't notify for Telegram poster, notify for message only
This commit is contained in:
parent
748aad16d7
commit
2835b1d28f
1 changed files with 4 additions and 1 deletions
|
@ -1858,13 +1858,16 @@ class TELEGRAM(object):
|
||||||
text = message.encode('utf-8')
|
text = message.encode('utf-8')
|
||||||
|
|
||||||
if self.incl_poster and 'metadata' in kwargs:
|
if self.incl_poster and 'metadata' in kwargs:
|
||||||
|
poster_data = {'chat_id': self.chat_id,
|
||||||
|
'disable_notification': True}
|
||||||
|
|
||||||
metadata = kwargs['metadata']
|
metadata = kwargs['metadata']
|
||||||
poster_url = metadata.get('poster_url','')
|
poster_url = metadata.get('poster_url','')
|
||||||
|
|
||||||
if poster_url:
|
if poster_url:
|
||||||
files = {'photo': (poster_url, urllib.urlopen(poster_url).read())}
|
files = {'photo': (poster_url, urllib.urlopen(poster_url).read())}
|
||||||
response = requests.post('https://api.telegram.org/bot%s/%s' % (self.bot_token, 'sendPhoto'),
|
response = requests.post('https://api.telegram.org/bot%s/%s' % (self.bot_token, 'sendPhoto'),
|
||||||
data=data,
|
data=poster_data,
|
||||||
files=files)
|
files=files)
|
||||||
request_status = response.status_code
|
request_status = response.status_code
|
||||||
request_content = json.loads(response.text)
|
request_content = json.loads(response.text)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue