From e13b6b34f4853248ec5d4c450ea56a70d46f4594 Mon Sep 17 00:00:00 2001 From: Clansty Date: Thu, 12 Dec 2024 22:20:35 +0800 Subject: [PATCH] fix: build --- main/src/models/Pair.ts | 2 +- main/src/models/TelegramSession.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main/src/models/Pair.ts b/main/src/models/Pair.ts index 82baf18a..6d753431 100644 --- a/main/src/models/Pair.ts +++ b/main/src/models/Pair.ts @@ -48,7 +48,7 @@ export class Pair { const lastHash = avatarCache ? avatarCache.hash : null; const avatar = await getAvatar(this.qqRoomId); const newHash = md5(avatar); - if (!lastHash || lastHash.compare(newHash) !== 0) { + if (!lastHash || Buffer.from(lastHash).compare(newHash) !== 0) { log.debug(`更新群头像: ${this.qqRoomId}`); await this._tg.setProfilePhoto(avatar); await db.avatarCache.upsert({ diff --git a/main/src/models/TelegramSession.ts b/main/src/models/TelegramSession.ts index 89be1982..fc4487da 100644 --- a/main/src/models/TelegramSession.ts +++ b/main/src/models/TelegramSession.ts @@ -48,7 +48,7 @@ export default class TelegramSession extends MemorySession { if (authKey && typeof authKey === 'object') { this._authKey = new AuthKey(); - await this._authKey.setKey(authKey); + await this._authKey.setKey(Buffer.from(authKey)); } if (dcId) { this._dcId = dcId;