Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
fix #282
Browse files Browse the repository at this point in the history
  • Loading branch information
takayama-lily committed Jan 4, 2022
1 parent 58a43ed commit 621007a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/message/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export function parseImageFileParam(file: string) {
let md5: string, size: number, width: number, height: number, ext: string
let sp = file.split("-")
md5 = sp[0].slice(0, 32)
size = Number(sp[0].slice(32)) | 0
width = Number(sp[1]) | 0
height = Number(sp[2]) | 0
size = Number(sp[0].slice(32)) || 0
width = Number(sp[1]) || 0
height = parseInt(sp[2]) || 0
sp = file.split(".")
ext = sp[1] || "jpg"
return { md5, size, width, height, ext }
Expand Down
2 changes: 1 addition & 1 deletion lib/message/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export class GroupMessage extends Message {
this.sender.nickname = this.sender.card = parseFunString(group[4].toBuffer())
if (ext?.[4])
this.sender.role = ext[4] === 8 ? "owner" : "admin"
this.sender.level = ext?.[3] | 0
this.sender.level = ext?.[3] || 0
this.sender.title = ext?.[7]?.toString() || ""

}
Expand Down

0 comments on commit 621007a

Please sign in to comment.