mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
Merge pull request #3808 from InfinityPacer/feature/plugin
This commit is contained in:
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
|
import copy
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
from typing import Any, Union, Dict, Optional
|
from typing import Any, Union, Dict, Optional
|
||||||
@@ -303,7 +304,7 @@ class Command(metaclass=Singleton):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# 命令
|
# 命令
|
||||||
cmd_data = command['data'] if command.get('data') else {}
|
cmd_data = copy.deepcopy(command['data']) if command.get('data') else {}
|
||||||
args_num = ObjectUtils.arguments(command['func'])
|
args_num = ObjectUtils.arguments(command['func'])
|
||||||
if args_num > 0:
|
if args_num > 0:
|
||||||
if cmd_data:
|
if cmd_data:
|
||||||
|
|||||||
@@ -225,7 +225,8 @@ class _PluginBase(metaclass=ABCMeta):
|
|||||||
return self.plugindata.del_data(plugin_id, key)
|
return self.plugindata.del_data(plugin_id, key)
|
||||||
|
|
||||||
def post_message(self, channel: MessageChannel = None, mtype: NotificationType = None, title: str = None,
|
def post_message(self, channel: MessageChannel = None, mtype: NotificationType = None, title: str = None,
|
||||||
text: str = None, image: str = None, link: str = None, userid: str = None, username: str = None):
|
text: str = None, image: str = None, link: str = None, userid: str = None, username: str = None,
|
||||||
|
**kwargs):
|
||||||
"""
|
"""
|
||||||
发送消息
|
发送消息
|
||||||
"""
|
"""
|
||||||
@@ -233,7 +234,7 @@ class _PluginBase(metaclass=ABCMeta):
|
|||||||
link = settings.MP_DOMAIN(f"#/plugins?tab=installed&id={self.__class__.__name__}")
|
link = settings.MP_DOMAIN(f"#/plugins?tab=installed&id={self.__class__.__name__}")
|
||||||
self.chain.post_message(Notification(
|
self.chain.post_message(Notification(
|
||||||
channel=channel, mtype=mtype, title=title, text=text,
|
channel=channel, mtype=mtype, title=title, text=text,
|
||||||
image=image, link=link, userid=userid, username=username
|
image=image, link=link, userid=userid, username=username, **kwargs
|
||||||
))
|
))
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user