Exemplo n.º 1
0
        def deleteAll():
            response = Connection.notificationRequest("delete-all", {})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Exemplo n.º 2
0
        def deleteOne():
            try:
                notificationId = int(input("Notification Id -> "))
            except ValueError:
                Common.printNegativeText("Notification id must be integer")

                return

            response = Connection.notificationRequest("delete-one",
                                                      {"id": notificationId})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Exemplo n.º 3
0
        def read():
            response = Connection.notificationRequest("read", {})
            notifications = response.get("notifications")

            Common.printNotificationText("Notifications:\n")

            for notification in notifications:
                if notification.get("content") is None:
                    continue

                notificationId = notification.get("id")
                date = notification.get("date")
                content = notification.get("content")

                Common.printNotificationText(
                    f"id -> {notificationId}\ndate -> {date}\ncontent -> {content}\n"
                )