Add Notification module to notify the user about the message.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
import asyncio
|
||||
import struct
|
||||
from notification_client.MessagePrinter import MessagePrinter
|
||||
from notification_client.notitication import Notification
|
||||
|
||||
|
||||
class Client:
|
||||
@@ -47,6 +48,8 @@ class Client:
|
||||
|
||||
MessagePrinter.print(title, message)
|
||||
|
||||
Notification.notify(title, message)
|
||||
|
||||
except asyncio.CancelledError:
|
||||
print('Something went wrong')
|
||||
finally:
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
from notifypy import Notify
|
||||
|
||||
|
||||
class Notification:
|
||||
@staticmethod
|
||||
def notify(title: str, message: str):
|
||||
notification = Notify()
|
||||
notification.title = title
|
||||
notification.message = message
|
||||
notification.send()
|
||||
|
||||
Reference in New Issue
Block a user