mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-03 23:37:09 +01:00 
			
		
		
		
	Fix json handling discord post
This commit is contained in:
		@@ -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,7 +198,8 @@ class DiscordREST:
 | 
				
			|||||||
            payload["embeds"] = [richembed]
 | 
					            payload["embeds"] = [richembed]
 | 
				
			||||||
            if not content:
 | 
					            if not content:
 | 
				
			||||||
                del payload["content"]
 | 
					                del payload["content"]
 | 
				
			||||||
            is_json = True
 | 
					            if not file:
 | 
				
			||||||
 | 
					                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
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user