Merge branch 'dev' of https://github.com/MaiM-with-u/MaiBot into dev
This commit is contained in:
@@ -674,7 +674,9 @@ class LogViewer:
|
|||||||
frame = ttk.Frame(inner_frame)
|
frame = ttk.Frame(inner_frame)
|
||||||
frame.pack(fill=tk.X, padx=5, pady=2)
|
frame.pack(fill=tk.X, padx=5, pady=2)
|
||||||
ttk.Label(frame, text=level).pack(side=tk.LEFT)
|
ttk.Label(frame, text=level).pack(side=tk.LEFT)
|
||||||
color_btn = ttk.Button(frame, text="选择颜色", command=lambda level_name=level: self.choose_color(level_name))
|
color_btn = ttk.Button(
|
||||||
|
frame, text="选择颜色", command=lambda level_name=level: self.choose_color(level_name)
|
||||||
|
)
|
||||||
color_btn.pack(side=tk.RIGHT)
|
color_btn.pack(side=tk.RIGHT)
|
||||||
# 显示当前颜色
|
# 显示当前颜色
|
||||||
color_label = ttk.Label(frame, text="■", foreground=self.formatter.level_colors[level])
|
color_label = ttk.Label(frame, text="■", foreground=self.formatter.level_colors[level])
|
||||||
|
|||||||
@@ -137,6 +137,39 @@ class BaseAction(ABC):
|
|||||||
text=content, user_id=str(chat_stream.user_info.user_id), platform=chat_stream.platform
|
text=content, user_id=str(chat_stream.user_info.user_id), platform=chat_stream.platform
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def send_type_reply(self, type: str, text: str) -> bool:
|
||||||
|
"""发送回复消息
|
||||||
|
|
||||||
|
Args:
|
||||||
|
text: 回复内容
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: 是否发送成功
|
||||||
|
"""
|
||||||
|
chat_stream = self.api.get_service("chat_stream")
|
||||||
|
if not chat_stream:
|
||||||
|
logger.error(f"{self.log_prefix} 没有可用的聊天流发送回复")
|
||||||
|
return False
|
||||||
|
|
||||||
|
if chat_stream.group_info:
|
||||||
|
# 群聊
|
||||||
|
return await self.api.send_message_to_target(
|
||||||
|
message_type=type,
|
||||||
|
content=text,
|
||||||
|
platform=chat_stream.platform,
|
||||||
|
target_id=str(chat_stream.group_info.group_id),
|
||||||
|
is_group=True,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
# 私聊
|
||||||
|
return await self.api.send_message_to_target(
|
||||||
|
message_type=type,
|
||||||
|
content=text,
|
||||||
|
platform=chat_stream.platform,
|
||||||
|
target_id=str(chat_stream.user_info.user_id),
|
||||||
|
is_group=False,
|
||||||
|
)
|
||||||
|
|
||||||
async def send_command(self, command_name: str, args: dict = None, display_message: str = None) -> bool:
|
async def send_command(self, command_name: str, args: dict = None, display_message: str = None) -> bool:
|
||||||
"""发送命令消息
|
"""发送命令消息
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user