Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR #31

Open
Anonym0us33 opened this issue Aug 7, 2023 · 1 comment
Open

PR #31

Anonym0us33 opened this issue Aug 7, 2023 · 1 comment

Comments

@Anonym0us33
Copy link

Anonym0us33 commented Aug 7, 2023

i tried to make a PR but i got an error
Pull request creation failed. Validation failed: must be a collaborator

        if "https://giphy.com/gifs/" in message_content:
            # Extract the giphy GIF URL from the message content
            start_index = message_content.index("https://giphy.com/gifs/")
            end_index = message_content.find(" ", start_index)
            if end_index == -1:
                tenor_url = message_content[start_index:]
            else:
                tenor_url = message_content[start_index:end_index]
            # Split the URL on forward slashes
            parts = tenor_url.split("/")
            # Extract the relevant words from the URL
            words = parts[-1].split("-")[:-1]
            # Join the words into a sentence
            sentence = " ".join(words)
            message_content = f"{message_content} [{message.author.name} posts an animated {sentence} ]"
            message_content = message_content.replace(tenor_url, "")
            return message_content
 giphy_pattern = re.compile(r'https://giphy.com/gifs/[\w-]+')


        elif giphy_pattern.search(message.content):
            return True

i lost my formatting and explanation of the code that I typed out because of the permission error so here you go.

@ausboss
Copy link
Owner

ausboss commented Aug 16, 2023

So what exactly is this doing? Does it replace the existing one for tenor.com/view or is to be used in conjunction with it in like an if/else statement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants