The A&W Burger Deal Notification App is designed to notify you when there is a $2 Teen burger deal on the A&W App through a toast notification on Windows 10.
The A&W Burger Deal Notification App seamlessly integrates with your daily routine to ensure you never miss out on a special $2 Teen Burger offer whenever the Toronto Maple Leafs play. Here's a detailed breakdown of how the app functions:
-
NHL Schedule Fetching: The app communicates with the NHL's official API (https://api-web.nhle.com/) to retrieve the game schedule for the Toronto Maple Leafs. This operation is performed every 24 hours to ensure the app has the most up-to-date information.
-
Date Comparison: Utilizing the
datetime
library, the app compares the current date with the Maple Leafs' game schedule. This step is crucial for determining whether there's a game on any given day. -
Notification Alert: If the app detects a match between today's date and a game day, it triggers a Windows notification. This alert serves as a friendly reminder that a $2 Teen Burger offer is available at A&W, tied to the Maple Leafs' game day.
By leveraging real-time data and timely notifications, the A&W Burger Deal Notification App ensures that you're always in the loop about the next opportunity to enjoy a discounted Teen Burger during Toronto Maple Leafs games.
If you receive the following error:
TypeError: WPARAM is simple, so must be an int object (got NoneType)
This indicates an issue with the handling of notification events. To resolve this, you need to update a function in the win10toast library, which is responsible for the toast notifications.
-
Find the win10toast Directory: Locate the
win10toast
directory inside your environment directory. This is typically found underLib\site-packages\win10toast
if you're using a virtual environment, or in your global Pythonsite-packages
directory. -
Modify
__init__.py
: Open the__init__.py
file within thewin10toast
directory for editing. -
Replace the
on_destroy
Function: In the__init__.py
file, find theon_destroy
function and replace it with the following code:def on_destroy(self, hwnd, msg, wparam, lparam): """Clean after notification ended. See https://learn.microsoft.com/en-us/windows/win32/winmsg/wm-destroy#return-value :hwnd: :msg: :wparam: :lparam: """ nid = (self.hwnd, 0) Shell_NotifyIcon(NIM_DELETE, nid) PostQuitMessage(0) return 0
This code is adapted from a pull request on the win10toast GitHub repository, specifically pull request #115.
-
Save Changes: After replacing the function, save the changes to the
__init__.py
file. -
Restart the App: Close and restart the A&W Burger Deal Notification App to ensure the changes take effect.
- It's always a good practice to back up the original
__init__.py
file before making any changes. - Ensure that your Python environment has the necessary permissions to modify the files in the
site-packages
directory.
By following these steps, you should be able to resolve the TypeError
and ensure that the notification functionality of the A&W Burger Deal Notification App works correctly.