New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
名片问题 #2657
Comments
嘿,@white-poto!很高兴再次见到你在这里提问。希望你一切都好! 在 Wechaty 中,如果你想要转发别人的名片消息到群组,你可以在群组(在 Wechaty 中是
以下是一个示例代码片段: import { Wechaty, Contact, Room } from 'wechaty';
async function forwardBusinessCard() {
const bot = new Wechaty();
await bot.start();
// 步骤 1:查找你想要转发的人的 Contact 对象
const contactToForward = await bot.Contact.find({ name: "Person's Name" });
// 确保找到了联系人
if (!contactToForward) {
console.log("Contact not found.");
return;
}
// 步骤 2:查找你想要转发名片的群组的 Room 对象
const room = await bot.Room.find({ topic: "Group Topic" });
// 确保找到了群组
if (!room) {
console.log("Room not found.");
return;
}
// 步骤 3:在 Room 对象上使用 say 方法,并将 Contact 对象作为参数传递
await room.say(contactToForward);
console.log("Business card forwarded successfully.");
}
forwardBusinessCard().catch(console.error); 在这个例子中,将 关于 async say (
sayable: Sayable,
): Promise<void> 在
相关资源: Sources
|
实际测试不支持该API: |
It seems like this issue requires a deeper look, @huan could you please lend your expertise? |
🚨 The issue tracker is not for questions 🚨
If you have a question, please ask it on https://stackoverflow.com/questions/tagged/wechaty
[如何才能转发别人发送的名片消息到群组呢?]
The text was updated successfully, but these errors were encountered: