mirror of
https://github.com/jxxghp/MoviePilot-Plugins.git
synced 2026-06-05 23:16:45 +00:00
103 lines
3.0 KiB
Markdown
103 lines
3.0 KiB
Markdown
# 如何扩展消息推送渠道?
|
||
|
||
返回 [README](../../README.md) | [FAQ 索引](../FAQ.md)
|
||
|
||
- 注册 `NoticeMessage` 事件响应,`event_data` 包含消息中的所有数据,参考 `IYUU消息通知` 插件:
|
||
|
||
注册事件:
|
||
```python
|
||
@eventmanager.register(EventType.NoticeMessage)
|
||
```
|
||
|
||
- 事件对象:
|
||
```json
|
||
{
|
||
"channel": MessageChannel|None,
|
||
"type": NotificationType|None,
|
||
"title": str,
|
||
"text": str,
|
||
"image": str,
|
||
"userid": str|int,
|
||
}
|
||
```
|
||
|
||
- MoviePilot中所有事件清单(V2版本),可以通过实现这些事情来扩展功能,同时插件之前也可以通过发送和监听事件实现联动(V1、V2事件清单有差异,且可能会变化,最新请参考源代码)。
|
||
```python
|
||
# 异步广播事件
|
||
class EventType(Enum):
|
||
# 插件需要重载
|
||
PluginReload = "plugin.reload"
|
||
# 触发插件动作
|
||
PluginAction = "plugin.action"
|
||
# 插件触发事件
|
||
PluginTriggered = "plugin.triggered"
|
||
# 执行命令
|
||
CommandExcute = "command.excute"
|
||
# 站点已删除
|
||
SiteDeleted = "site.deleted"
|
||
# 站点已更新
|
||
SiteUpdated = "site.updated"
|
||
# 站点已刷新
|
||
SiteRefreshed = "site.refreshed"
|
||
# 转移完成
|
||
TransferComplete = "transfer.complete"
|
||
# 下载已添加
|
||
DownloadAdded = "download.added"
|
||
# 删除历史记录
|
||
HistoryDeleted = "history.deleted"
|
||
# 删除下载源文件
|
||
DownloadFileDeleted = "downloadfile.deleted"
|
||
# 删除下载任务
|
||
DownloadDeleted = "download.deleted"
|
||
# 收到用户外来消息
|
||
UserMessage = "user.message"
|
||
# 收到Webhook消息
|
||
WebhookMessage = "webhook.message"
|
||
# 发送消息通知
|
||
NoticeMessage = "notice.message"
|
||
# 订阅已添加
|
||
SubscribeAdded = "subscribe.added"
|
||
# 订阅已调整
|
||
SubscribeModified = "subscribe.modified"
|
||
# 订阅已删除
|
||
SubscribeDeleted = "subscribe.deleted"
|
||
# 订阅已完成
|
||
SubscribeComplete = "subscribe.complete"
|
||
# 系统错误
|
||
SystemError = "system.error"
|
||
# 刮削元数据
|
||
MetadataScrape = "metadata.scrape"
|
||
# 模块需要重载
|
||
ModuleReload = "module.reload"
|
||
|
||
|
||
# 同步链式事件
|
||
class ChainEventType(Enum):
|
||
# 名称识别
|
||
NameRecognize = "name.recognize"
|
||
# 认证验证
|
||
AuthVerification = "auth.verification"
|
||
# 认证拦截
|
||
AuthIntercept = "auth.intercept"
|
||
# 命令注册
|
||
CommandRegister = "command.register"
|
||
# 整理重命名
|
||
TransferRename = "transfer.rename"
|
||
# 整理拦截
|
||
TransferIntercept = "transfer.intercept"
|
||
# 资源选择
|
||
ResourceSelection = "resource.selection"
|
||
# 资源下载
|
||
ResourceDownload = "resource.download"
|
||
# 发现数据源
|
||
DiscoverSource = "discover.source"
|
||
# 媒体识别转换
|
||
MediaRecognizeConvert = "media.recognize.convert"
|
||
# 推荐数据源
|
||
RecommendSource = "recommend.source"
|
||
# 工作流执行
|
||
WorkflowExecution = "workflow.execution"
|
||
# 存储操作选择
|
||
StorageOperSelection = "storage.operation"
|
||
```
|