-
Notifications
You must be signed in to change notification settings - Fork 7
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
Implement EN Kantine Parsing #238
Conversation
Hi @Emily3403, this is great, thank you so much for your contribution! I was able to verify that your changes work and the chat messages it generates look good 👍
Nothing wrong with either. If anything, we should add more type hints to the source code 🙂 I think I found one issue:
I was wondering if this was also an issue in the old implementation, but I think it was not because f2e2634#diff-db16d995ef351cde6d57cb6aaa888c1c2751bc4b6d6d72edc8c5ac24125f8dabL29 checked the actual date string on the website. Thinking about possible solutions, my first idea is to change the
What do you think? Let me know if anything is unclear or if you think there is a mistake in my thoughts. ℹ️ I just merged two major updates of the python-telegram-bot library to main and did some necessary code changes in Thanks again for your contribution! I am looking forward to get this released 🚀 |
Thank you for your detailed response 😊 I've just implemented a fix for the issue you've spotted. Instead of using an |
Thanks for working on the fix 👍 Unfortunately, I don't think it works as intended. I think I would use the string representation of the date as the key to avoid this issue. |
Yep, I totally overlooked that. I kind of thought that datetime would work in a I've tested the parsing against last weeks menu by mocking the date in the How exactly should one handle weekends? Simply put the empty menu with all the fillers in the database? |
Awesome, I can confirm that it works now 👍
When there is no matching menu in redis the bot responds with
That you got an error during testing is most likely because you set yourself as admin via the |
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.
Nice work, thanks again for your contribution! 🚀
Hi there,
inspired by #221 I decided to implement parsing for the EN Kantine. With my local setup, I am able to parse and query the menu for the current week. I'm not quite sure if there is a way to look at the menu of next week, however that could be implemented too.
A great deal of the code is inspired by f2e2634, especially
format_dish
. Thank you for mentioning it as it made the implementation a lot easier.Feel free to criticize code style and type hints. I've added them because it makes programming in my setup easier, however for consistency I totally see if they should be removed.