Skip to content

Commit

Permalink
Add support for the new /supreme endpoint. (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab authored Feb 12, 2023
1 parent 5bedf1c commit 2644bc7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion alexflipnote/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .errors import *
from .enums import *

__version__ = "4.0.0"
__version__ = "4.0.1"
__author__ = "Soheab"
__license__ = "MPL-2.0"
__description__ = "An easy to use Python Wrapper for the AlexFlipnote API"
16 changes: 16 additions & 0 deletions alexflipnote/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,22 @@ async def scroll(self, text: str) -> Image:
url = await self.__http.with_image(Endpoint.SCROLL, text=text)
return Image(url, self.__http._session) # type: ignore

async def supreme(self, text: str) -> Image:
"""Returns a supreme image.
Parameters
----------
text: :class:`str`
The text to display on the image.
Returns
-------
:class:`.Image`
The image object.
"""
url = await self.__http.with_image(Endpoint.SUPREME, text=text)
return Image(url, self.__http._session) # type: ignore

async def did_you_mean(self, top: str, bottom: str) -> Image:
"""Returns a did you mean message.
Expand Down
1 change: 1 addition & 0 deletions alexflipnote/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Endpoint(_BaseEnum):
FACTS = "/facts"
PORNHUB = "/pornhub"
SCROLL = "/scroll"
SUPREME = "/supreme"


class WithJsonEndpoint(_BaseEnum):
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ See here what changed or broke each version.

---

### 4.0.1 - February 12, 2023

- Add support for the new `/supreme` endpoint.

### v4.0.0 - December 8, 2022
Ayo another major release! A lot of endpoints that were previously removed are now back!!

Expand Down
8 changes: 8 additions & 0 deletions docs/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ Returns a scroll message.

---

### await alex_api.supreme(text: [str]) -> [Image]
Returns a supreme message.

#### Parameters
- text ([str]) - The text to display on the image.

---

### await alex_api.sillycat(left_hex: [Optional]\[[str]] = ``None``, right_hex: [Optional]\[[str]] = ``None``, *, random: [bool] = ``True``, seed: [Optional]\[[Any]] = None, return_image: [bool] = ``False``) -> [SillyCat]
Generates a SillyCat image

Expand Down

0 comments on commit 2644bc7

Please sign in to comment.