使用path 进行预览发送
This commit is contained in:
@@ -6,6 +6,7 @@ import json
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from flask import Blueprint, render_template, jsonify, request, current_app, session
|
||||
from pathlib import Path
|
||||
from werkzeug.utils import secure_filename
|
||||
from .auth import login_required
|
||||
from loguru import logger
|
||||
@@ -287,7 +288,7 @@ def api_preview_task(task_id):
|
||||
|
||||
# 发送图片消息
|
||||
if task.get('content_image'):
|
||||
send_message_in_thread(server.client.send_image_message, recipient, task['content_image'])
|
||||
send_message_in_thread(server.client.send_image_message, recipient, Path(task['content_image']))
|
||||
|
||||
# 发送链接消息
|
||||
if task.get('content_link'):
|
||||
|
||||
@@ -3,6 +3,7 @@ from datetime import datetime
|
||||
from typing import Dict, Any, List, Optional, Tuple
|
||||
|
||||
from loguru import logger
|
||||
from pathlib import Path
|
||||
|
||||
from base.plugin_common.message_plugin_interface import MessagePluginInterface
|
||||
from base.plugin_common.plugin_interface import PluginStatus
|
||||
@@ -169,7 +170,7 @@ class MessagePushTask(MessagePluginInterface):
|
||||
|
||||
# 发送图片消息
|
||||
if content_image:
|
||||
await self.bot.send_image_message(group_id, content_image)
|
||||
await self.bot.send_image_message(group_id, Path(content_image))
|
||||
|
||||
# 发送链接消息
|
||||
if content_link:
|
||||
|
||||
Reference in New Issue
Block a user