(msg: Api.Message)
| 187 | left: role.x, |
| 188 | }; |
| 189 | } |
| 190 | |
| 191 | async function downloadProfilePhoto(msg: Api.Message): Promise<Buffer | null> { |
| 192 | const replied = await safeGetReplyMessage(msg); |
| 193 | const fromId = replied?.senderId; |
| 194 | if (!fromId) { |
| 195 | await msg.edit({ text: "无法获取对方头像" }); |
| 196 | return null; |
| 197 | } |
| 198 | |
| 199 | const buf = (await msg.client?.downloadProfilePhoto(fromId, { |
| 200 | isBig: false, |
| 201 | })) as Buffer | undefined; |
| 202 | if (!buf) return null; |
| 203 | return buf; |
| 204 | } |
| 205 |