Skip to content

Commit

Permalink
chore: 可选关闭 有一条来自 QQ 的消息转发失败 提示
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Jan 24, 2025
1 parent 7f2d6ec commit 59d4e9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions main/src/constants/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum flags {
NAME_LOCKED = 1 << 17,
ALWAYS_FORWARD_TG_FILE = 1 << 18,
QQ_HEADER_IMAGE = 1 << 19,
DISABLE_ERROR_NOTIFY = 1 << 20,
}

export default flags;
12 changes: 7 additions & 5 deletions main/src/services/ForwardService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,17 +705,19 @@ export default class ForwardService {
event,
messageToSend,
}));
pbUrl += '.json';
if (pbUrl)
pbUrl += '.json';
this.log.info('错误报告', pbUrl);
}
catch (e) {
this.log.error('上传到 Pastebin 失败', e);
}
try {
await pair.tg.sendMessage({
message: '<i>有一条来自 QQ 的消息转发失败</i>',
buttons: pbUrl ? [[Button.url('查看详情', pbUrl)]] : [],
});
if (!((pair.flags | this.instance.flags) & flags.DISABLE_ERROR_NOTIFY))
await pair.tg.sendMessage({
message: '<i>有一条来自 QQ 的消息转发失败</i>',
buttons: pbUrl ? [[Button.url('查看详情', pbUrl)]] : [],
});
}
catch {
}
Expand Down

0 comments on commit 59d4e9b

Please sign in to comment.