diff --git a/plugins/QQNotePlugin/QQNotePlugin.cs b/plugins/QQNotePlugin/QQNotePlugin.cs index c0120d19a..f652a1463 100644 --- a/plugins/QQNotePlugin/QQNotePlugin.cs +++ b/plugins/QQNotePlugin/QQNotePlugin.cs @@ -138,12 +138,14 @@ public void OnFriendMessage((Bot s, FriendMessageEvent e) obj, string message, u #region 图片文件形式 string dirName = Path.GetFileNameWithoutExtension(settingsModel.GitHub.RepoTargetFilePath); - string imageFileName = $"image-{DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")} {imageBytes.GetHashCode()}.{imageType}"; - string imageHtml = $""; + // 注意: 图片文件名不能有空格, 否则会导致在 GitHub 无法预览 + string imageFileName = $"image-{DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")}-{imageBytes.GetHashCode()}.{imageType}"; + //string imageHtml = $""; // Markdown 图片标记 容易不显示 - //string imageMd = $"![{Path.GetFileNameWithoutExtension(imageFileName)}]({dirName}/{imageFileName})"; + string imageMd = $"![{Path.GetFileNameWithoutExtension(imageFileName)}]({dirName}/{imageFileName})"; imageDic.Add($"{dirName}/{imageFileName}", imageBytes); - fullMessageSb.AppendLine(imageHtml); + //fullMessageSb.AppendLine(imageHtml); + fullMessageSb.AppendLine(imageMd); #endregion } catch (Exception ex) @@ -221,7 +223,7 @@ public void OnFriendMessage((Bot s, FriendMessageEvent e) obj, string message, u } catch (Exception ex) { - obj.s.SendFriendMessage(friendUin, "笔记中的图片写入失败:"); + obj.s.SendFriendMessage(friendUin, $"{item.Key} 笔记中的图片写入失败:"); obj.s.SendFriendMessage(friendUin, ex.ToString()); } } diff --git a/plugins/QQNotePlugin/info.json b/plugins/QQNotePlugin/info.json index f06b764f4..3c5444c33 100644 --- a/plugins/QQNotePlugin/info.json +++ b/plugins/QQNotePlugin/info.json @@ -3,6 +3,6 @@ "DisplayName": "QQ写笔记", "Description": "利用 QQ 写笔记 (随笔/零碎知识点)", "Author": "yiyun", - "Version": "0.1.1", + "Version": "0.1.2", "SupportedVersions": [ "0.0.1" ] } \ No newline at end of file