Skip to content
This repository has been archived by the owner on Feb 11, 2018. It is now read-only.

Commit

Permalink
Changed a few things. And Version bump to v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AraHaan committed Mar 24, 2017
1 parent c186107 commit 4e4de20
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 122 deletions.
4 changes: 2 additions & 2 deletions discord_webhooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
__author__ = 'Decorater'
__license__ = 'MIT'
__copyright__ = 'Copyright 2017 Decorater'
__version__ = '0.0.2'
__build__ = 0x000002
__version__ = '0.0.3'
__build__ = 0x000003

__all__ = webhooks.__all__
7 changes: 5 additions & 2 deletions discord_webhooks/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def __init__(self, bot):

@asyncio.coroutine
def request_webhook(self, partialurl, content=None, username=None,
avatar_url=None, tts=False, file=None, embeds=None):
avatar_url=None, tts=False, file=None, embeds=None,
filename=None):
"""Requests an webhook with the data provided to this function."""
if self.create_form_data:
self.create_form_data = False
Expand All @@ -62,6 +63,8 @@ def request_webhook(self, partialurl, content=None, username=None,
self.tts = tts
self.file = file
self.embeds = embeds
if filename is None:
filename = 'image.jpg'
if self.partialurl is not None:
if self.content is not None:
self.payload['content'] = self.content
Expand All @@ -78,7 +81,7 @@ def request_webhook(self, partialurl, content=None, username=None,
if self.create_form_data:
self.form = aiohttp.FormData()
self.form.add_field('payload_json', discord.utils.to_json(self.payload))
self.form.add_field('file', self.file, filename='image.jpg', content_type='multipart/form-data')
self.form.add_field('file', self.file, filename=filename, content_type='multipart/form-data')
yield from self.http.request(
WebHookRoute(
'POST',
Expand Down
84 changes: 0 additions & 84 deletions docs/example.html

This file was deleted.

33 changes: 0 additions & 33 deletions docs/index.html

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

requirements = []

version = '0.0.2'
version = '0.0.3'

if not version:
raise RuntimeError('version is not set')
Expand Down

0 comments on commit 4e4de20

Please sign in to comment.