-
Notifications
You must be signed in to change notification settings - Fork 18
Flickr api #1205
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
Flickr api #1205
Conversation
…need to update errors and rate limit.
…e, but failed. It is only using public domain photo, so we don't have to credit anyone
dkay0670
left a comment
There was a problem hiding this 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).
ajax146
left a comment
There was a problem hiding this 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|
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. |
|
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 |
|
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 |

Added new extension to look up most animals