NTFYClient¶
-
class ntfpy.
NTFYClient
(server: NTFYServer, topic: str, user: NTFYUser | None = None)¶ - Variables:
server (
NTFYServer
)topic (
str
)user (Optional[
NTFYUser
])
-
send
(message: str, title: str | None = None, priority: Literal[1, 2, 3, 4, 5] | None = None, tags: str | None = None, click: str | None = None, attach: NTFYUrlAttachment | None = None, actions: Sequence[NTFYAction] | None = None, email: str | None = None, delay: str | None = None, icon: str | None = None) Response ¶ - Parameters:
message (
str
) – message’s contenttitle (Optional[
str
]) – message’s titlepriority (Optional[
PRIORITY
]) – message’s prioritytags (Optional[Sequence[
str
]]) – message’s tagsclick (Optional[
str
]) – message’s click urlattach (Optional[
NTFYUrlAttachment
]) – message’s url attachmentactions (Optional[Sequence[
NTFYAction
]]) – message’s actionsemail (Optional[
str
]) – message’s emaildelay (Optional[
str
]) – message’s delayicon (Optional[
str
]) – message’s icon url
- Return type:
-
send_message
(message: NTFYPushMessage) Response ¶ - Parameters:
message (
NTFYPushMessage
) – message to send
-
async
subscribe
(handler: ~typing.Callable[[~ntfpy.types.message.NTFYMessage], None] = <built-in function print>)¶ - Parameters:
handler (Callable[[
NTFYMessage
],None
]) – function to handle printing of received messages; by default it’sprint()