From 2644bc7a269fc046bb60af2506077f473ccc2f1f Mon Sep 17 00:00:00 2001 From: Soheab_ <33902984+Soheab@users.noreply.github.com> Date: Sun, 12 Feb 2023 17:28:10 +0100 Subject: [PATCH] Add support for the new `/supreme` endpoint. (#11) --- alexflipnote/__init__.py | 2 +- alexflipnote/client.py | 16 ++++++++++++++++ alexflipnote/enums.py | 1 + changelog.md | 4 ++++ docs/methods.md | 8 ++++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/alexflipnote/__init__.py b/alexflipnote/__init__.py index 6b92825..f9ff800 100644 --- a/alexflipnote/__init__.py +++ b/alexflipnote/__init__.py @@ -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" diff --git a/alexflipnote/client.py b/alexflipnote/client.py index a0b5e08..6cdcdbf 100644 --- a/alexflipnote/client.py +++ b/alexflipnote/client.py @@ -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. diff --git a/alexflipnote/enums.py b/alexflipnote/enums.py index 5e060e9..01e15b1 100644 --- a/alexflipnote/enums.py +++ b/alexflipnote/enums.py @@ -29,6 +29,7 @@ class Endpoint(_BaseEnum): FACTS = "/facts" PORNHUB = "/pornhub" SCROLL = "/scroll" + SUPREME = "/supreme" class WithJsonEndpoint(_BaseEnum): diff --git a/changelog.md b/changelog.md index daacda4..ea2a0cc 100644 --- a/changelog.md +++ b/changelog.md @@ -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!! diff --git a/docs/methods.md b/docs/methods.md index d9e2aff..b4c6c0f 100644 --- a/docs/methods.md +++ b/docs/methods.md @@ -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