Merge branch 'Clansty:rainbowcat' into rainbowcat

This commit is contained in:
谷風天音 | 是一个浓度纯度都比较高的柚子厨,因为柚子社天下第一!时不时发柚子的癫。有个能干的妹妹真好,たにかぜ あまね天下第一喵,关注谷風天音谢谢喵,关注谷風天音谢谢喵,谢谢在这里看我发癫,天音妹妹真的好好看喵,单推天音一辈子!谁不推天音就打爆他的宁宁的起爆器!\柚子社/\柚子社/\柚子社/\天音/\天音/\天音/天音,我真的好喜欢你啊,为了你,我要 0721!\たにかぜ あまね/\たにかぜ あまね/\たにかぜ あまね/\たにかぜ あまね/\たにかぜ あまね/\たにかぜ あまね/\たにかぜ あまね/ 2023-02-21 23:53:16 +08:00 committed by GitHub
commit af1dee0ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 18 deletions

View File

@ -4,7 +4,13 @@ nix2container.buildImage {
maxLayers = 8;
# optimizations
layers = with pkgs;[
(nix2container.buildLayer { deps = [ bash ]; })
(nix2container.buildLayer {
copyToRoot = pkgs.buildEnv {
name = "root";
paths = [ pkgs.bash pkgs.coreutils ];
pathsToLink = [ "/bin" ];
};
})
(nix2container.buildLayer { deps = [ nodejs ]; })
# deps of sharp
(nix2container.buildLayer {
@ -27,7 +33,7 @@ nix2container.buildImage {
(
pkgs.writeScript "start" ''
#!${pkgs.bash}/bin/bash
${pkgs.coreutils}/bin/mkdir -p /tmp /root/.cache
mkdir -p /tmp /root/.cache
${flakePkgs.prisma-patched}/bin/prisma db push --accept-data-loss --skip-generate --schema ${flakePkgs.default}/libexec/q2tg/node_modules/.prisma/client/schema.prisma
${flakePkgs.default}/bin/q2tg
''

View File

@ -236,9 +236,13 @@ export default class ForwardService {
if (quote) {
replyTo = quote.tgMsgId;
}
else{
message+='\n\n<i>*回复消息找不到</i>'
}
}
catch (e) {
this.log.error('查找回复消息失败', e);
message+='\n\n<i>*查找回复消息失败</i>'
}
}
@ -291,22 +295,11 @@ export default class ForwardService {
if (message.photo instanceof Api.Photo ||
// stickers 和以文件发送的图片都是这个
message.document?.mimeType?.startsWith('image/')) {
// 将 webp 转换为 png防止 macOS 不识别
if (message.document?.mimeType === 'image/webp') {
const convertedPath = await convert.png(message.document.id.toString(16), () => message.downloadMedia({}));
chain.push({
type: 'image',
file: convertedPath,
asface: true,
});
}
else {
chain.push({
type: 'image',
file: await message.downloadMedia({}),
asface: !!message.sticker,
});
}
chain.push({
type: 'image',
file: await message.downloadMedia({}),
asface: !!message.sticker,
});
brief += '[图片]';
}
else if (message.video || message.videoNote || message.gif) {
@ -442,9 +435,25 @@ export default class ForwardService {
time: quote.time,
};
}
else {
source = {
message: '回复消息找不到',
seq: 1,
time: Math.floor(new Date().getTime() / 1000),
rand: 1,
user_id: this.oicq.uin,
};
}
}
catch (e) {
this.log.error('查找回复消息失败', e);
source = {
message: '查找回复消息失败',
seq: 1,
time: Math.floor(new Date().getTime() / 1000),
rand: 1,
user_id: this.oicq.uin,
};
}
}