diff options
| author | Rapptz <[email protected]> | 2015-12-07 02:34:31 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-12-07 16:22:56 -0500 |
| commit | 9102f1ae4f7def1e9426d9080dd8103689f0efcb (patch) | |
| tree | 2c54059dd10376f79b74cc75189850933dc667e5 /discord/utils.py | |
| parent | Use @me endpoint for Client.start_private_message (diff) | |
| download | discord.py-9102f1ae4f7def1e9426d9080dd8103689f0efcb.tar.xz discord.py-9102f1ae4f7def1e9426d9080dd8103689f0efcb.zip | |
Work on connecting to a voice channel.
Diffstat (limited to 'discord/utils.py')
| -rw-r--r-- | discord/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/utils.py b/discord/utils.py index ff035508..97584b31 100644 --- a/discord/utils.py +++ b/discord/utils.py @@ -29,6 +29,7 @@ from .errors import HTTPException, Forbidden, NotFound, InvalidArgument import datetime from base64 import b64encode import asyncio +import json def parse_time(timestamp): if timestamp: @@ -88,6 +89,9 @@ def _bytes_to_base64_data(data): b64 = b64encode(data).decode('ascii') return fmt.format(mime=mime, data=b64) +def to_json(obj): + return json.dumps(obj, separators=(',', ':'), ensure_ascii=True) + try: create_task = asyncio.ensure_future except AttributeError: |