(buffer: Buffer)
| 60 | return String(raw); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | async function downloadEntityAvatar(client: any, entity: any): Promise<Buffer | undefined> { |
| 65 | if (!client || !entity) return undefined; |
| 66 | const key = stableEntityKey(entity); |
| 67 | if (key && avatarCache.has(key)) return avatarCache.get(key); |
| 68 | |
| 69 | // Resolve a full entity with photo + accessHash. getSender() may return a |