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

Callers 1

downloadAvatarFunction · 0.85

Calls 1

editMethod · 0.45

Tested by

no test coverage detected