Skip to content

Commit 255c91a

Browse files
committed
feat(utils): 添加apiError路径并优化图片消息发送
在Render.js中添加apiError的HTML路径映射 在Base.js中简化图片消息发送逻辑,直接发送img对象而非使用segment.image包装
1 parent e87e283 commit 255c91a

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

module/utils/Base.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class Base {
144144
await sendMasterMessage('bilibili', img)
145145
throw new Error(err.data.amagiMessage)
146146
}
147-
await e.reply(segment.image(img))
147+
await e.reply(img)
148148
throw new Error(err.data.amagiMessage)
149149
}
150150
return result
@@ -331,12 +331,12 @@ export const statBotId = (pushList) => {
331331
*/
332332
const sendMasterMessage = async (platform, img) => {
333333
if (Version.BotName === 'TRSS-Yunzai') {
334-
Bot.sendMasterMsg(['推送任务出错!请即时解决以消除警告', segment.image(img)])
334+
Bot.sendMasterMsg(['推送任务出错!请即时解决以消除警告', img])
335335
} else {
336336
const botId = statBotId(Config.pushlist)
337337
const masterList = cfg.masterQQ
338338
for (const masterQQ of masterList) {
339-
await Bot[botId[platform].botId].pickFriend(masterQQ).sendMsg(['推送任务出错!请即时解决以消除警告', segment.image(img)])
339+
await Bot[botId[platform].botId].pickFriend(masterQQ).sendMsg(['推送任务出错!请即时解决以消除警告', img])
340340
}
341341
}
342342
}

module/utils/Render.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ export const Render = async (path, params) => {
114114
admin: 'admin/html',
115115
kuaishou: 'kuaishou/html',
116116
help: 'help/html',
117-
version: 'version/html'
117+
version: 'version/html',
118+
apiError: 'apiError/html'
118119
}
119120
const platform = Object.keys(basePaths).find(key => path.startsWith(key))
120121
if (platform) {

0 commit comments

Comments
 (0)