diff --git a/main/src/models/Pair.ts b/main/src/models/Pair.ts index 82baf18..6d75343 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 89be198..fc4487d 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;