Fix bug with uploading file-like objects.

I would require bytes-like objects instead due to its usage inside
the HTTPClient. Release this restriction so old `send_file` code works.
This commit is contained in:
Rapptz
2016-06-12 22:41:30 -04:00
parent 64c1e7d199
commit f3b257b342
2 changed files with 3 additions and 4 deletions

View File

@ -29,7 +29,6 @@ import asyncio
import json
import sys
import logging
import io
import inspect
import weakref
from random import randint as random_integer
@ -239,7 +238,7 @@ class HTTPClient:
form.add_field('content', str(content))
form.add_field('tts', 'true' if tts else 'false')
form.add_field('file', io.BytesIO(buffer), filename=filename, content_type='application/octet-stream')
form.add_field('file', buffer, filename=filename, content_type='application/octet-stream')
return self.post(url, data=form, bucket='messages:' + str(guild_id))