aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-12-24 05:11:06 -0500
committerRapptz <[email protected]>2017-01-03 09:52:02 -0500
commit79a49f91458159564ae5a7696797829c6a848a5d (patch)
tree0b588b8c3ef275f47061e8da47e6ca8a88403080 /discord/http.py
parentRename MessageChannel.send_message to send and unify interface. (diff)
downloaddiscord.py-79a49f91458159564ae5a7696797829c6a848a5d.tar.xz
discord.py-79a49f91458159564ae5a7696797829c6a848a5d.zip
Absolute import some circular dependencies to appease Python 3.4.
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/discord/http.py b/discord/http.py
index 2a9798ac..2eda3c8a 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -36,7 +36,9 @@ from random import randint as random_integer
log = logging.getLogger(__name__)
from .errors import HTTPException, Forbidden, NotFound, LoginFailure, GatewayNotFound
-from . import utils, __version__
+from . import __version__
+
+import discord.utils
@asyncio.coroutine
def json_or_text(response):
@@ -97,7 +99,7 @@ class HTTPClient:
# some checking if it's a JSON request
if 'json' in kwargs:
headers['Content-Type'] = 'application/json'
- kwargs['data'] = utils.to_json(kwargs.pop('json'))
+ kwargs['data'] = discord.utils.to_json(kwargs.pop('json'))
kwargs['headers'] = headers
with (yield from lock):
@@ -244,7 +246,7 @@ class HTTPClient:
if embed:
payload['embed'] = embed
- form.add_field('payload_json', utils.to_json(payload))
+ form.add_field('payload_json', discord.utils.to_json(payload))
form.add_field('file', buffer, filename=filename, content_type='application/octet-stream')
return self.post(url, data=form, bucket='messages:' + str(guild_id))