use-py / use-notify

一个简易且可扩展的消息通知组件,已内置钉钉,企微,bark,pushover,pushdeer,邮件等消息通知组件

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

一个简单可扩展的异步消息通知库

Package version Supported Python versions

安装

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="消息正文")

支持的消息通知渠道列表

  • Wechat
  • Ding
  • Bark
  • Email
  • Chanify
  • Pushdeer
  • Pushover

自己开发消息通知

from use_notify import useNotifyChannel


class Custom(useNotifyChannel.BaseChannel):
    """自定义消息通知"""

    def send(self, *args, **kwargs):
        ...

    async def send_async(self, *args, **kwargs):
        ...

About

一个简易且可扩展的消息通知组件,已内置钉钉,企微,bark,pushover,pushdeer,邮件等消息通知组件


Languages

Language:Python 97.8%Language:Makefile 2.2%