Skip to content

Conversation

@TheKrol
Copy link
Contributor

@TheKrol TheKrol commented Dec 24, 2024

Added new extension to look up most animals

@dkay0670
Copy link
Contributor

cannot test
image

Copy link
Contributor

@dkay0670 dkay0670 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we're keeping the original animal extension, I think this command should be re-written to just be a generic flickr api. Changing the descriptions and removing the tags.

If it is intending to replace the original animal extension, that should be removed in this PR, since they both use the animal command (this one as an alias to flickr).

Copy link
Contributor

@ajax146 ajax146 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should definitely be a generic Flickr, not a .animal replacement

Additionally, as this is new, I will request all new modules are app command only, ie please make this /flickr instead of .flickr

If possible, please remove the except Exception, its generally bad form to catchall exceptions, and the catching process actually prevents it from being logged. The specific catch from the FlickrError is acceptable though.

Finally, add a check to not load the extension if the API key isn't configured, akin to how its done in GitHub.py

    try:
        if not bot.file_config.api.github.api_key:
            raise AttributeError("IssueCreator was not loaded due to missing API key")
        if not bot.file_config.api.github.username:
            raise AttributeError("IssueCreator was not loaded due to missing API key")
        if not bot.file_config.api.github.repo:
            raise AttributeError("IssueCreator was not loaded due to missing API key")
    except AttributeError as exc:
        raise AttributeError(
            "IssueCreator was not loaded due to missing API key"
        ) from exc

@TheKrol
Copy link
Contributor Author

TheKrol commented May 2, 2025

What exactly do you expect to be made more generic? I want the description to be animal focus because that would be the main use of this extension.

I can change it to a slash command, and add a check for api key.

@ajax146
Copy link
Contributor

ajax146 commented May 2, 2025

Given that we can't do aliases with slash commands, either it needs to be /flickr, in which case I wouldn't expect it to be animal only, but a generic call to the flickr api, akin to google images.

Or alternatively, add this to the animal.py file, either replace cat, dog, frog and fox, and make this /animal {search} or maybe a /animal generic {search}, leaving room for /animal cat, /animal dog, etc

@ajax146
Copy link
Contributor

ajax146 commented May 2, 2025

I'm actually going to update on this, given the state of the flickr API, I think replacing the cat/dog/etc commands is a bad idea. I see lots of people saying their API keys were just invalidated, so we can use this until we cannot partake in the flickr API anymore.

As such, I'd recommend either going with /flickr or /animal generic

@TheKrol TheKrol closed this May 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants