mirror of
https://github.com/caronc/apprise.git
synced 2025-06-22 18:51:42 +02:00
Fixes Discord error code 50006 when sending message (#180)
This commit is contained in:
parent
4692941efa
commit
054b674852
@ -42,6 +42,7 @@
|
|||||||
#
|
#
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
|
from json import dumps
|
||||||
|
|
||||||
from .NotifyBase import NotifyBase
|
from .NotifyBase import NotifyBase
|
||||||
from ..common import NotifyImageSize
|
from ..common import NotifyImageSize
|
||||||
@ -319,9 +320,12 @@ class NotifyDiscord(NotifyBase):
|
|||||||
if attach:
|
if attach:
|
||||||
files = {'file': (attach.name, open(attach.path, 'rb'))}
|
files = {'file': (attach.name, open(attach.path, 'rb'))}
|
||||||
|
|
||||||
|
else:
|
||||||
|
headers['Content-Type'] = 'application/json; charset=utf-8'
|
||||||
|
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
notify_url,
|
notify_url,
|
||||||
data=payload,
|
data=payload if files else dumps(payload),
|
||||||
headers=headers,
|
headers=headers,
|
||||||
files=files,
|
files=files,
|
||||||
verify=self.verify_certificate,
|
verify=self.verify_certificate,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user