Skip to content

Commit

Permalink
fix trash endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab committed Jul 1, 2020
1 parent 018a4d9 commit 94eefa5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions alexflipnote/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,19 +314,19 @@ async def supreme(self, text, dark=False, light=False):
return Image(url, self._http_client)

async def trash(self, face: str, trash: str):
user_url = url_regex.UrlRegex(str(face))
if not user_url.detect:
face_url = url_regex.UrlRegex(str(face))
if not face_url.detect:
raise BadRequest("String passed is not a valid URL.")
if user_url.links[0].domain != "cdn.discordapp.com":
if face_url.links[0].domain != "cdn.discordapp.com":
raise BadRequest("Only Discord CDN URLs are allowed...")

user2_url = url_regex.UrlRegex(str(trash))
if not user2_url.detect:
trash_url = url_regex.UrlRegex(str(trash))
if not trash_url.detect:
raise BadRequest("String passed is not a valid URL.")
if user2_url.links[0].domain != "cdn.discordapp.com":
if trash_url.links[0].domain != "cdn.discordapp.com":
raise BadRequest("Only Discord CDN URLs are allowed...")

url = self._api_url(f"trash?user={face}&user2={trash}")
url = self._api_url(f"trash?face={face}&trash={trash}")

return Image(url, self._http_client)

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

setup(
name = 'alexflipnote.py',
version = '1.2.5',
version = '1.2.6',
packages = ['alexflipnote'],
url = 'https://github.com/Soheab/Alexflipnote.py',
download_url = 'https://github.com/Soheab/alexflipnote.py/archive/1.2.5.tar.gz',
download_url = 'https://github.com/Soheab/alexflipnote.py/archive/1.2.6.tar.gz',
license = 'MIT',
author = 'Soheab',
author_email = '',
Expand Down

0 comments on commit 94eefa5

Please sign in to comment.