MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / downloadProfilePhoto

Function downloadProfilePhoto

eat/eat.ts:189–202  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

187 left: role.x,
188 };
189}
190
191async 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

Callers 1

downloadAvatarFunction · 0.85

Calls 1

editMethod · 0.45

Tested by

no test coverage detected