pip install use-notify
from use_notify import useNotify, useNotifyChannel
# if you use usepy, also can use `usepy.plugin`
# from usepy.plugin import useNotify, useNotifyChannel
notify = useNotify()
notify.add(
# 添加多个通知渠道
useNotifyChannel.Bark({"token": "xxxxxx"}),
useNotifyChannel.Ding({
"token": "xxxxx",
"at_all": True
})
)
notify.publish(title="消息标题", content="消息正文")
- Ding
- Bark
- Chanify
- Pushdeer
- Pushover
from use_notify import useNotifyChannel
class Custom(useNotifyChannel.BaseChannel):
"""自定义消息通知"""
def send(self, *args, **kwargs):
...
async def send_async(self, *args, **kwargs):
...