-
Notifications
You must be signed in to change notification settings - Fork 20
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
Feature/add meme command #64
Conversation
Won't work because of issue #65. |
@@ -0,0 +1,102 @@ | |||
{ |
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.
We will need a way to access that list from Discord, maybe a command or something
Without autocomplete of command this will be insanly hard to remember
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.
I was thinking about thinking about linking to a page on the website, but that isn't ideal. Sending a huge list through discord messages isn't ideal either. Open to suggestions.
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.
We add the list to firestore then ?
request_json: Optional[dict] = request.get_json(silent=True) | ||
|
||
with open(MEME_FILE, "r", encoding="utf-8") as meme_file: | ||
memes: dict = json.load(meme_file) |
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.
Why not make memes.json
a python dict file so that we don't need to open files ?
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.
Using a JSON seems like better practice than using a hard coded dictionary. Especially because it probably is going to be modified often.
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.
JSON or python CONSTANT is the same, we just use python import and not file read
|
||
|
||
@patch.dict(os.environ, {"IMGFLIP_API_USERNAME": "TEST", "IMGFLIP_API_PASSWORD": "TEST"}, clear=True) | ||
@patch(f"{MODULE_PATH}.open", mock_open(read_data='{"TestMeme": "TestID"}'), create=True) |
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.
See meme.json as python file to remove those mock
For issue #63
Feature: