mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-11-15 02:21:21 +01:00
Fix json handling discord post
This commit is contained in:
parent
d067e17cbd
commit
8cc3a24389
@ -48,7 +48,7 @@ class DiscordREST:
|
|||||||
data = None
|
data = None
|
||||||
if 'data' in kwargs:
|
if 'data' in kwargs:
|
||||||
data = kwargs['data']
|
data = kwargs['data']
|
||||||
if 'json' in kwargs:
|
if 'json' in kwargs and kwargs["json"] != False:
|
||||||
headers['Content-Type'] = 'application/json'
|
headers['Content-Type'] = 'application/json'
|
||||||
data = json.dumps(data)
|
data = json.dumps(data)
|
||||||
|
|
||||||
@ -198,6 +198,7 @@ class DiscordREST:
|
|||||||
payload["embeds"] = [richembed]
|
payload["embeds"] = [richembed]
|
||||||
if not content:
|
if not content:
|
||||||
del payload["content"]
|
del payload["content"]
|
||||||
|
if not file:
|
||||||
is_json = True
|
is_json = True
|
||||||
r = self.request("POST", _endpoint, data=payload, json=is_json)
|
r = self.request("POST", _endpoint, data=payload, json=is_json)
|
||||||
return r
|
return r
|
||||||
|
Loading…
Reference in New Issue
Block a user