diff --git a/changelog.md b/changelog.md index eb899500..a054687b 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,9 @@ Changes since 2026.06.15 ## Fun +### Giphy +- Fixes giphy command not correctly returning the image + ## Internal ## Moderation diff --git a/modules/fun/giphy.py b/modules/fun/giphy.py index 1bc41096..8c4b7d56 100644 --- a/modules/fun/giphy.py +++ b/modules/fun/giphy.py @@ -41,22 +41,9 @@ class Giphy(cogs.BaseCog): SEARCH_LIMIT (int): The max amount of gifs to search for """ - GIPHY_URL: str = "http://api.giphy.com/v1/gifs/search?q={}&api_key={}&limit={}" + GIPHY_URL: str = "https://api.giphy.com/v1/gifs/search?q={}&api_key={}&limit={}" SEARCH_LIMIT: int = 10 - @staticmethod - def parse_url(url: str) -> str: - """Parses the raw API url into a useable gif link - - Args: - url (str): The raw URL from Giphy - - Returns: - str: The direct link to the gif, if it exists - """ - index = url.find("?cid=") - return url[:index] - @auxiliary.with_typing @commands.guild_only() @commands.command( @@ -90,8 +77,7 @@ async def giphy(self: Self, ctx: commands.Context, *, query: str) -> None: embeds = [] for item in data: - url = item.get("images", {}).get("original", {}).get("url") - url = self.parse_url(url) + url = item.get("embed_url", {}) embeds.append(url) await ui.PaginateView().send(ctx.channel, ctx.author, embeds)